2

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 

2 Answers 2

8

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.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks. So pull fetches the changes from the remote repo and merges them, and merge only merge changes from one local branch to another local branch?
2

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 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.