4

I am learning GIT (with Git Flow) and I know its not good to use StackOverflow instead of a book.

I am involved in a project. There are two feature branches named F1 and F2 maintained by groups G1 and G2. Assume F1 depends on F2 and G1 has published its branch using git flow feature publish F1.

Now G2 needs to track F1 and well may be do a re-base on top of F1 from time to time. For this I red that we need to use git flow track

So I (of G2) used some thing like this

git flow feature checkout F2
git flow feature track F1

But Git is saying the following:

Branch 'feature/F1' already exists. Pick another name.

Then I tried a name that didn't and hoped it will at some point ask me for the branch that needs to be tracked. But then I got this message.

git flow feature track F1_track
Branch 'origin/feature/F1_track' does not exist and is required.

Am I doing some thing silly? Could it be an issue with my installation?

I believe you understand what I am trying to do, could you please help me out in the issue.

Ziyan Junaideen
  • 2,914
  • 5
  • 38
  • 67

1 Answers1

7

When you consider the code of git flow feature track, all that it does is creating a local branch tracking a remote one.

If you already have a local feature/F1 branch, check that it does track origin/feature/F1 with git branch -av:

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • Now it makes sense, so `tracking` means we make a local `F1` feature that tracks a remote `F1` feature. If we wan't to fetch the changes done to the F1 after checking out F2 we could use `rebase ` like (on F2) `git rebase feature/F1`. It worked! – Ziyan Junaideen May 16 '13 at 04:16
  • Note to self: with that upvote+tick combo, I passed 300K on May, 16th 2013 (took me 4 years and 8 months to get there too) – VonC May 16 '13 at 05:19