Sunday, May 27, 2018

Git – merging conflicts

git commit -am <message>       # add & commit your local changes
git pull origin master         # pull the latest codes
git status                     # see the files that have conflicted (untracked files)

# If you want to keep your changes then
git checkout . --ours

# Or, if you want to keep remote changes
git checkout . --theirs
git commit -am <message>           # add & commit with a new message
git push origin master             # push to remote  

source: https://stackoverflow.com/a/40800624/260238

No comments:

Post a Comment