1

Possible Duplicate:
Is it possible to alias a branch in Git?

We have a public and an internal version for our code. Right now we have 2 branches and we have to manually commit change to each to keep them in sync. Is there a way to create an alias or something that will let devs with in a single branch with 2 different names?

The idea is one group of devs only knows and works with public version so they would do a git checkout pub-1.0.0 and another department worth of devs only knows internal versions so they would do a git checkout dev-1.2.3.

Both groups devs should be working with the same code. a commit to pub-1.0.0 should be seen in dev-1.2.3 and visa verse.

Is this setup possible?

Community
  • 1
  • 1
Justin808
  • 20,859
  • 46
  • 160
  • 265
  • 2
    I believe this answers your question: http://stackoverflow.com/questions/549920/is-it-possible-to-alias-a-branch-in-git – George Skoptsov Nov 20 '12 at 18:59
  • See also [Git 2.39 (Q4 2022) git symbolic-ref --no--recurse HEAD`](https://stackoverflow.com/a/74172104/6309) to find the name of your alias branch. – VonC Oct 23 '22 at 14:55

1 Answers1

1

From Is it possible to alias a branch in Git? :

you can create a symbolic reference to the master branch:

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

Note that trunk isn't a first class citizen. If you checkout trunk and perform a git status you will actually be on master, however you can use the trunk command in all places that you use the branch name (log, merge, etc.).

Community
  • 1
  • 1
George Skoptsov
  • 3,831
  • 1
  • 26
  • 44