Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating the current branch from parent branch

Tags:

git

I created a new git branch B from branch A with tracking option.

Now, when A branch gets updated by few commits, I want to pull the commits to B as well, so I can keep track of it, and do not have to face big change sometimes later.

How should I approach this? Is it automatically done in git?

like image 542
user482594 Avatar asked Jul 26 '11 20:07

user482594


People also ask

How do I merge parent branch to child branch?

You want to bring changes from development branch to feature branch. So first switch to feature branch and merge development branch into it. In case you want the commits from develop branch too, use the non fast forward merge --no-ff approach. Else do not use --no-ff .


1 Answers

This is not made automatically. You have to manually merge your changes from A to B, which is pretty simple. Just switch to branch B and do

git merge A 

Which will automatically merge your changes from A to B. As long as you don't have any conflicts, all of the changes in A will be marked as merged in B. A common best practices is to make daily merges, but that is dependent on the number of users/commits using your branch.

like image 109
HackerGil Avatar answered Oct 12 '22 22:10

HackerGil