There is remote branch: R
There is local branch: L (which was created based on R)
So the graph is
R--R1---R2--- \ L--L1--
Right now, I just need keep L branch always have the updates from R
What is the simplest way I can do this?
I think the answer is to:
But this does not seem very straightforward and I need do some conflict handling manually.
You want to make L a tracking branch for R. You can do this with the command.
git branch --track L remote/R
Then, any time you are on branch L, just run git pull remote and it will pull updates and automatically merge them into your repository.
https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches
You can pull directly into L from R. Assuming L is checked out:
git pull origin R
L doesn't have to be tracking branch for you to pull in remote 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