venta: (Default)
[personal profile] venta
In a radical departure from asking people what they're wearing, I would now like to ask for help with git. If you don't understand the question, just be very grateful and move on ;-)

When an incoming git pull suffers a merge failure[*], why, why, does git decide to compound the problem by staging every modified file it can lay its grubby little paws on?

I assumed that if I started typing "why does git stage..." into Google it would auto-complete with all the various phrases distressed people all over the internet have typed in. It does not, and I can't find anyone writing about it. For bonus points, tell me how to stop it doing this - but I'll settle for understanding the rationale behind it!

[*] Which, if the two versions have changed lines anywhere near each other, it will

Date: 2015-11-13 07:23 am (UTC)
From: [identity profile] venta.livejournal.com
In theory I use git stash. However, I am not terribly organised, so it often goes:

Me: right, ready! Commit these files, and push them.
Git. No.
Me: Why not?
Git: New stuff in the repo. Try pulling.
Me: Oh, all right.
Git: Ha! Merge conflict, I've staged everything!
Me: Dammit, should have stashed.

Every so often I think I really should get to grips properly with git, but I always get instantly bogged down reading about it, because everything basically reads like this: http://git-man-page-generator.lokaltog.net/

Date: 2015-11-13 08:15 am (UTC)
From: [identity profile] qatsi.livejournal.com
Aha! Maybe you should not think of commit and push as a single step. You should be able to commit locally regardless of changes in a remote repo. Commit, then pull and resolve conflicts, then push.

Date: 2015-11-13 08:22 am (UTC)
From: [identity profile] venta.livejournal.com
I don't really think of them as a single step, I was just trying to stop my dialogue getting too long :)

Date: 2015-11-13 08:19 am (UTC)
From: [identity profile] qatsi.livejournal.com
You do know about http://git-scm.com/book/en/v2 ?

Date: 2015-11-13 08:22 am (UTC)
From: [identity profile] venta.livejournal.com
I'm not sure that I've tried that reference specifically - I'll give it a go if you recommend it!

Profile

venta: (Default)
venta

December 2024

S M T W T F S
1234567
891011121314
15161718192021
2223 2425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 26th, 2025 06:00 pm
Powered by Dreamwidth Studios