Under this section, some Git merging strategies will be introduced. Always ask other People before merging branches.
Rebase-Merge (Preferred)
Rewrites the feature branch history to make it appear as if it was developed on top of the current develop branch. This creates a linear history for the feature branch commits and a merge commit when the feature branch is finally merged.
git checkout develop
git pull
git checkout <branch>
git rebase develop
git push --force
git checkout develop
git merge --no-ff <branch>
git push
git branch -d <branch>
You can call
git config merge.ff false
to change config. Then you can callgit merge <branch>
instead ofgit merge --no-ff <branch>
for future uses.
Merge (Alternative)
Retains the original commit history and creates a merge commit. The history will show exactly where the branches diverged and merged.
git checkout develop
git pull
git merge <branch>
git push