I work in develop branch. Sometimes, when I want to push changes to origin, git say, that there are some changes in origin/master branch.
How to pull changes from remote master to local master without checkout to local master?
In case you are using the Tower Git client, pulling from a remote is very easy: simply drag the remote branch and drop it onto your current HEAD in the sidebar - or click the "Pull" button in the toolbar.
git pull origin master will pull changes from the origin remote, master branch and merge them to the local checked-out branch. git pull origin/master will pull changes from the locally stored branch origin/master and merge that to the local checked-out branch.
If you want to update your local master without checkout, you can do :
git pull origin master:master
That will update your local master with the origin/master
Or, as I assume that you want to ultimately rebase your develop
branch with the changes occured in origin/master
, you can do a simple git fetch
, that will not touch your local branches :
git fetch
Now your origin/master
is up to date, so you can rebase or merge your local branch with these changes. For example, when you are in your develop
branch :
git rebase origin/master
And your develop branch will be up to date with the changes.
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