git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Unstaging during a merge conflict

From
MMMatt McClellan <mcclellan.mj@gmail.com>
Date
Oct 2, 2012, 01:13 UTC
Message-ID
<CAHUDv6qM37nua2uB6TDOmf1a5L_TUFz=0q=v5W=9MrpEmWoShg@mail.gmail.com>

We had an issue at our organization where changes were reverted when a user was merging his local repo with the remote repo changes. The merge conflicted and he unstaged all the changes that were not a conflict, he then resolved the conflict and added just the conflicted file and committed. The end result was that he reverted every change from his last pull of the remote to his merge point. The problem I'm having how hard it is to see this problem as both git show and git log on the merge commit do not show any reverted files. It was found by diffing his commit to each of the parents and seeing the opposite of what we expected in the patch output.

Anybody have ideas how we can prevent these mistakes? While we are going to do more training, a hard stop that wouldn't even let these make it to remote would be preferred.

I've done this using git add --interactive then reverting a files changes, though the actual crime was done using egit staging tool. It seems the command line won't let you unstage changes but gui tools and interactive tools seem to allow it.

Next: Junio C Hamano
Message 1 of 3 in “Unstaging during a merge conflict”
  1. Matt McClellanOct 2, 2012
  2. Junio C HamanoOct 2, 2012
  3. Jeff KingOct 3, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.