Reputation: 1581
I am cloning this particular repo in which it initially already has a Pull Request done by one of my colleague but I was not made aware of it..
Basically, this is what I did:
It was only at my PR page (I am using Atlassian), then I realized that my colleague has actually opened up another PR, which is still open but his branch naming is different from mine..
This is evidenced by the top part of the PR page which shows the name of branch and which to be merged..
feature/Issue01 -> develop
remotes/origin/feature/Issue01 -> develop
My questions here is: 1. am I creating an additional branch? If so, will this cause any issues if they were merged into the develop?
git checkout -b feature/Issue01 remotes/origin/feature/Issue01
Upvotes: 1
Views: 56
Reputation: 17262
git checkout -b
is used to create a new local branch. You're not using it quite right.
The easiest way to do what I think you're trying to do is git checkout feature/Issue01
. If that branch doesn't exist locally (it shouldn't), git will detect that it does exist upstream, and it will pull it and set up tracking info for you.
On any branch, you can use git branch -u origin/feature/Issue01
to have the local brancy that you're currently on track whatever upstream branch you specify.
Alternatively, something like this would work: $ git checkout -b feature/Issue01 --track origin/feature/Issue01
Upvotes: 2