Git merges conflict resets everything
source link: https://www.codesd.com/item/git-merges-conflict-resets-everything.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Git merges conflict resets everything
I had to roll back the Live server and now I'm getting conflict errors when trying to merge my dev branch with master as they are out of sync.
Is there any way of simply resetting everything so I can merge dev with master?
Dev is correct and I'm happy to Overwrite master but don't want to work out all the conflicts through mergetool if possible.
Depends what is your goal, there are two options:
git checkout dev
git merge -s ours master
It leaves the merged result to be exactly the dev
, really, it just marks master
as a parent of dev
but do nothing to dev
in source level.
git checkout dev
git merge -X ours master
It do a merge as usual, but automatically use the piece from dev
if there is a conflict. That means, if something master
introduced conflicts with dev
, it prefers dev
, but with those does NOT conflict, it involves them in merged result.
Related Articles
Git merges conflict with workspace.xml
Git merges conflicts when no changes are made
How do I see a & ldquo; three way diff & rdquo; for a Git merge conflict?
iOS - git merge conflicts after adding cocoapods to the project
Git merge conflict shows 2 branches
Git Merge Conflict: Add changes to validate when resolved?
Xcode project file git merge conflict
how exactly is a git merge conflict?
Git merge conflict resolution shows step changes that I did not do
How do you view / display a git merge conflict resolution that was performed, given a merge, commit SHA1?
Resetting a commit git merge, then resetting
Git merge conflicting files when pulling
How to use the Sublime text editor to resolve git merge conflicts?
Git: currently merging / conflict with remote private account. How can I tell Git to use my local files?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK