Reputation: 76870
I've a branch on a remote repository and i want to bring that branch locally so i can do a rebase. I've added the repo of the remote branch which is called github. If i do
git checkout -b feature/AIOEC-168
git pull github feature/AIOEC-168
a merge occur. I would like to copy feature/AIOEC-168 locally and then on that branch do git rebase develop
, how can i do that?
Upvotes: 0
Views: 144
Reputation: 91837
On any halfway-recent version of git, you can just git checkout feature/AIOEC-168
, which will detect the similarly-named branch in origin
and create a local branch of the same name, tracking the origin
branch.
Upvotes: 0
Reputation: 44234
If you want a local version of the remote branch that also sets the remote's branch as upstream, use git checkout
's --track
flag:
git checkout --track github/feature/AIOEC-168
That will create feature/AIOEC-168
locally, it'll be identical to the github
remote's version (and will also set up that version as the upstream tracking branch), and you can rebase from there with any rebase command you'd like.
Upvotes: 1