user429400
user429400

Reputation: 3325

git pull changes to sub branch

I've cloned a repository called A and created a new branch called Li.
Now someone updated A's master branch and I've pulled the changes to my master branch using:

git checkout master
git pull origin master

Now I want to update my branch (Li) with the changes. How do I do it?

In adittion, after updating my local branch with the changes, I need to update the remote Li branch with the changes as well, right? Do I do it by using:

git checkout Li
git push origin Li 

Upvotes: 2

Views: 8421

Answers (2)

aschmid00
aschmid00

Reputation: 7158

you first merge branch master with branch Li

git checkout Li
git merge master

then you push the local Li branch to the remote repository

git push origin Li

Upvotes: 2

CharlesB
CharlesB

Reputation: 90316

To merge changes from master in your Li branch, use the following commands:

git checkout Li
git merge master

You're right for pushing changes to origin, this will create a new Li branch on origin.

Upvotes: 8

Related Questions