Raw File
Tip revision: 7d1229ee2bd79aaba6ee4ef19ba35ccffede8eb4 authored by Prashant Pandey on 13 August 2019, 04:20:32 UTC
Merge branch 'development'
Tip revision: 7d1229e

if [ $# -eq 0 ]
    echo "No input arguments provided.  Usage is <branch_to_merge_in>"
    exit 1


# from
# in case branchA is not our current branch
git checkout development

# make merge commit but without conflicts!!
# the contents of 'ours' will be discarded later
git merge -s ours ${feature}

# make temporary branch to merged commit
git branch branchTEMP

# get contents of working tree and index to the one of branchB
git reset --hard ${feature}

# reset to our merged commit but 
# keep contents of working tree and index
git reset --soft branchTEMP

# change the contents of the merged commit
# with the contents of branchB
git commit --amend

# get rid off our temporary branch
git branch -D branchTEMP

# verify that the merge commit contains only contents of branchB
git diff HEAD ${feature}
back to top