Reputation: 244
(This question is related to Merge, update, and pull Git branches without using checkouts but different.)
On local machine, I have a feature branch (say feature_1) and master branch. I need frequently rebase the feature branch to master, etc by
git pull --rebase origin master
After this command, my feature branch will be updated.
Is it possible (how) to update local master branch without checkout it?
(My repro is on local feature branch). I tried "git pull master". But it prompted:
fatal: 'master' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
My current way is: After
git pull --rebase origin master (A)
I run
git checkout master
git pull (B)
git checkout feature1
It's bad because:
Thanks.
Upvotes: 0
Views: 2321
Reputation: 606
First, pull the remote branch to your local master
using
git fetch origin master:master
as mentioned in your linked question. Then, rebase on your local master branch with
git rebase master
to address point 2.
Upvotes: 5