Borek Bernard
Borek Bernard

Reputation: 53211

Make git master follow / track another local branch

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?

Upvotes: 2

Views: 73

Answers (1)

VonC
VonC

Reputation: 1323343

You can try and use git symbolic-ref:

git symbolic-ref refs/heads/master refs/heads/branch3

Upvotes: 3

Related Questions