1

Is it possible to give one branch two names?

The situation I have is that our team gave a branch a long, unwieldy name. Now, I'd like to give it another, shorter name for convenience. Is that possible? We're using github enterprise.

Edit: I need the alias (by whatever mechanism it is aliased) to exist in the central github enterprise-hosted repo, and NOT just be local to my repo.

Marcin
  • 48,559
  • 18
  • 128
  • 201
  • http://stackoverflow.com/questions/549920/is-it-possible-to-alias-a-branch-in-git – Petr Skocik Sep 11 '14 at 20:01
  • @PSkocik That's not the same thing at all. Based on the accepted answer, that question is looking for a local solution. I need one that will exist in the hosted repo. – Marcin Sep 11 '14 at 20:30
  • This is , because you dont want to remove the old name for the branch ? (so, you need to preserve the branch with both names ?) – dseminara Sep 11 '14 at 20:54
  • @dseminara Yep, I don't want anything to break because of absence of the original branch name. – Marcin Sep 11 '14 at 21:02

2 Answers2

1

Another option is to have a local branch with whatever name you'd like (shorter, more convenient) track a remote branch with the original name:

git branch --track short-name long-unwieldly-branch-name-from-remote
Tonio
  • 1,516
  • 1
  • 15
  • 25
  • 3
    To do the same and checkout the branch immediately `git checkout -b short-name origin/long-unwieldly-branch-name-from-remote` – Andrew C Sep 11 '14 at 20:22
-1

I think that a symbolic reference is what you're looking for:

Is it possible to alias a branch in Git?

Community
  • 1
  • 1
Daniel Scott
  • 7,418
  • 5
  • 39
  • 58