Table of Contents
#PRE-REQUISITES
Make sure that your local repository is committed or stashed.
If not, Git will complain, since it is basic versioning procedure.
ALTERNATIVE#1
Suppose that your current branch is “feature/branch1”.
Do:
git commit -am “before merging”
or if already committed you may mark this operation using:
git commit –allow-empty -am”before merging operation with develop branch”
git checkout develop
git pull develop
– create a new merging local branch:
git checkout -b feature/branch1_merge
– testing, just in case:
git merge feature/branch1
Merge your conflicts without messing the working branch.
If something goes wrong, you may delete the local branch, and restart the operation faster and without any setback, since the working directory is fully untouched.
git branch -d feature/branch1_merge
Run the application to test the operation.
ALTERNATIVE#2
Overwrites all local files, and the merge is performed just over your working files.
Suppose that your current branch is “feature/branch1”.
Do:
git commit -am “before merging”
or if already committed you may mark this operation using:
git commit –allow-empty -am”before merging operation with develop branch”
git checkout develop
git pull develop
– create a new merging local branch:
git checkout -b feature/branch1_merge
– testing, just in case:
git merge -X theirs feature/branch1
Merge your working files using the source from “feature/branch1”.
If something goes wrong, you may delete the local branch, and restart the operation faster and without any setback, since the working directory is fully untouched.
git branch -d feature/branch1_merge
Run the application to test the operation.
ALTERNATIVE#3
It is not recommended, unless in critical cases when lacking time is an issue.
Get a list of your working files (those you want to merge).
Perform a merge operation file by file straight into the target, in this example, you use the source from “feature/branch1” and the respective target from “develop”.
Brazilian system analyst graduated by UNESA (University Estácio de Sá – Rio de Janeiro). Geek by heart.