How to update Git branch from another branch

Given that a Git branch is not up to date with another branch, how to merge changes?

I am working on a Git branch, and neither that branch nor the changes I made on another branch are up to date.

Therefore, I had to merge these changes. Given that a Git branch is not up to date with another branch, how to merge changes?

You check out the branch you want to update:

git checkout my-branch

Then merge from the branch to be updated:

git merge another-branch

This will create a merge commit which will include all the differences between the two branches-in a single commit.

Also check mineGit guide.


More git tutorials: