Reputation: 129
Assuming I have two remote branches dev1 and dev2 and two local branches dev1 and dev2 respectively.
If my current local branch is dev1, can I do git pull --rebase from the remote branch dev2 to local branch dev1.
I don't want to this with git merge.
Upvotes: 0
Views: 59
Reputation: 43023
You should be able to do it if you first set the upstream branch for your local branch dev1 as dev2. This will then replay all commits that are different in dev1 on top of commits from origin/dev2 (you may need to change the name of the remote repository).
git branch -u origin/dev2
You may need to change the upstream branch back, depending on what you want to achieve.
Upvotes: 1