Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

git force merge branch

# Migrate to the branch you want to merge into
git checkout <branch_name>

# Merge branch_b into branch you're in
git merge <branch_name>

# Force merge if the branches have unrelated histories. This means
# you must have previously gotten an error message like this 
# 'fatal: refusing to merge unrelated histories' when you try to do
# normal merge with the command above.
git merge -X theirs <branch_name> --allow-unrelated-histories
 
PREVIOUS NEXT
Tagged: #git #force #merge #branch
ADD COMMENT
Topic
Name
2+8 =