Create a branch alias? [duplicate] Create a branch alias? [duplicate] git git

Create a branch alias? [duplicate]


Please see here: https://stackoverflow.com/a/549949/606723

You can rename the master branch trunk as Greg has suggested, or you can also create a trunk that is a symbolic reference to the master branch so that both git and svn users have the 'main' branch that they are used to.

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.).


Git does not support aliases for branches.

This means you will have to rely on variables in your script to make model="branch.2012.10.17" or something like that. Your script would do something like this then:

git checkout $model

I'm leaving the rest of this answer here for where we came from in this discussion:

A very involved discussion on branching strategy can be found here: http://dymitruk.com/blog/2012/02/05/branch-per-feature/

Specifically, take a look at the role of the integration branch and the release candidate branch. This may be what you are looking for.

Look at git as something that takes a snapshot of your working directory, not as histories of folders.

progit.org/book explains the Directed Acyclic Graph that stores the history. All references are just things that point to nodes in it. That should clarify how you want to construct your workflow.

make a start tag - version2.1. from there make your int-version2.1 (using nubmers instead of dates for brevity). Any work you start, start from the version 2.1 tag. merge the work into the int-version2.1. Others will do the same.


In case when you need branch per feature — answer of Adam Dymitruk is correct,But in case when you need save links branch - specific state (based on time), without changed them you can use git tags.

I used tags for store states of each prod releases.