2014-08-11

What to do when git pull conflict before commit?

Sometimes we want to pull from git without committing current changes, and yes, the correct way is to commit our changes first before pulling, so we could merge the conflict. But if you doesn't want to do that, there are some trick that you could use, that is git stash, the usage example:

# to store all changes on the stash
git stash
# this should no longer conflict
git pull
# to overwrite from previous stash
git stash pop
# you could see the difference using
git diff

No comments :

Post a Comment

THINK: is it True? is it Helpful? is it Inspiring? is it Necessary? is it Kind?