17

I would like to start working on another developer's feature branch (we use git and git flow). AFAIK The branch has been published (pushed). How can I get it to my local repository?

I tried:

git flow feature pull origin/XXXXXX-1003b

fatal: 'origin/XXXXXX-1003b' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Failed to pull from remote 'origin/XXXXXX-1003b'.

And:

git flow feature pull XXXXXX-1003b

fatal: 'XXXXXX-1003b' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Failed to pull from remote 'XXXXXX-1003b'.

Please advise. Thanks

FazoM
  • 4,777
  • 6
  • 43
  • 61

3 Answers3

33

git flow feature track

To track an existing feature branch on a remote, use feature track:

git flow feature track xxxxxx-1003b

Alternatively just do it "the normal way":

git fetch origin
git branch -a # list all branches
git checkout feature/xxxxxx-1003b

I.e. update the remote origin, and then checkout the branch corresponding to your colleague's branch.

Community
  • 1
  • 1
AD7six
  • 63,116
  • 12
  • 91
  • 123
8

If you don't have the branch inside your repo, and you want to get it, you have to use git-flow track. This should work:

git flow feature track XXXXXX-1003b
Pigueiras
  • 18,778
  • 10
  • 64
  • 87
  • What does `-1003b` mean? I saw that in another answer and thought it was just a random alphanumeric, but they're identical, so does it have some significance? – Travis Heeter Jul 29 '20 at 14:05
3

You can also use the feature/branch name(1):

git flow feature track featurename

(1) Could be a new git flow feature, I respond to an old question.