Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resolving conflict in git

Tags:

git

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"?

like image 588
Dziamid Avatar asked Jul 25 '11 15:07

Dziamid


1 Answers

git checkout HEAD -- path/to/file
like image 124
avh4 Avatar answered Sep 25 '22 15:09

avh4