9

I notices that quite often, when I have conflicts, I simply want to choose. For example, when applying a stash I ran into this:

sfGuardGroup: g1: label: Project Manager name: manager <<<<<<< Updated upstream Permissions: [p_manager] Children: [g2, g3, g4, g5] ======= Permissions: [p_manager, p2, p3, p4, p5, p_request] >>>>>>> Stashed changes g2: label: Junior PM (USA) name: junior-manager-usa Permissions: [p_junior, p_junior_usa, p_request] ... 

I know exactly that I want to keep everything that is marked "Updated upstream" and drop \ ignore "Stashed changes". Is it possible to just tell git to "Use upstream version of this file"?

1
  • What does "upstream version" refer to? The version of the file before applying the stash? Commented Jun 7, 2018 at 2:35

1 Answer 1

6
git checkout HEAD -- path/to/file 
Sign up to request clarification or add additional context in comments.

3 Comments

What if I want to do the opposite; that is, keep the stashed changes?
To keep the stashed changes instead: If git stash pop results in conflicts it doesn't actually drop the applied stash, so you should be able to do git checkout stash@{0} -- path/to/file
loved your answer

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.