(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:
- Not convenient, especially feature_1 has temp change.
- I want local master and local feature branch stay on the same base commit. Because there are time gap between (A) and (B), they could reach different base commit.
Thanks.