Sometimes we need to work with a team or remotely from home one please to another. So GitHub is the best place for this to avoid problems loosing project and work together. So When we create a project and create branches for others. They need to keep up to date with master branch. So We face problem how to keep up to date other branches with master.
Asked
Active
Viewed 481 times
1 Answers
1
You can do rebase which keeps your branch upto date with master. Rebase will pull all the changes.
git rebase origin/master
So the workflow will be
Checkout to master on your local using
git checkout master
Do pull using
git pull
Then checkout to your desired branch using
git checkout yourbranchname
Then do rebase
git rebase origin/master
If any merge conflict occurs then resolve it !! if not then you are lucky :)

Dashrath Mundkar
- 7,956
- 2
- 28
- 42
-
@Mukta yes it will fetch all the changes from master. – Dashrath Mundkar Sep 17 '20 at 14:35
-
Possible duplicate https://stackoverflow.com/questions/14605231/git-merge-branch-into-master . And if not, you can find the answer here. – mr rogers Sep 17 '20 at 14:35
-
Yeah, I followed that before but I was looking for elaborate answer. Like someone works in the branch didn't git add. Did git merge with master or something did mismatch so it's like unsatisfied answer. But you did really great. I am happy with our answer. Thank you so much. – Mukta Sep 17 '20 at 14:41