I realize there are many questions on syncing branches, and the difference between git commands, but I am finding it hard to know what is the correct process for this.
I am the maintainer of a repository on GitHub. One of the members on my team cloned the repo, created a new-feature
branch, pushed this new-feature
branch into the GitHub repository, and created a pull request to merge it into master
. I approved the pull request and merged it into master
on the GitHub website.
What is the correct process to pull this 'new master' down to update my local repository so I have my local directory synchronized, cleanly and without re-writing any history?
git pull
--> essentially does a git fetch
then git merge
...into the branch I'm on?git pull --rebase
--> essentially does a git fetch
then git rebase
? git fetch
then git merge origin/master
--> same as option 1?git fetch
then git rebase origin/master
--> same as option 2?git pull
or git pull --rebase
are the canonical ways to achieve what you need - sync your local branch with the branch it follows on the server.
Generally speaking, if you use pull requests, you don't want to make any direct changes to the master branch - everything should go via branches. This strategy (it's not a technical requirement) is a common methodology that teams around choose. One benefit is that you never have merge issues when pulling master.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With