2

We have a Git repository with a couple of branches that live side by side, e.g. branch1, branch2 and branch3. The goal is to make master always point to the same commit as the HEAD of, say, branch3.

When googling the term "branch tracking" the articles almost always concern remote tracking. Can the same be achieved for local branches?

Borek Bernard
  • 50,745
  • 59
  • 165
  • 240

1 Answers1

3

You can try and use git symbolic-ref:

git symbolic-ref refs/heads/master refs/heads/branch3
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I'm surprised. I don't understand which `git symbolic-ref` syntax of the three detailed in the man page you're using here. Does `refs/heads/master` count as a symbolic reference? – jub0bs Sep 29 '14 at 09:11
  • @Jubobs it simply modifies the content to `.git/refs/heads/master` file, in order to reference not a SHA1, but the name of another branch. See http://stackoverflow.com/a/549949/6309 – VonC Sep 29 '14 at 09:13