Pros and cons of using git revisions instead of branches as references for rollouts

I am working on a phing script with git for build automation, and am still new to it. To give a little idea, we plan to have multiple branches in our project, and any of them could be rolled out (we are almost certain about this part).

During the course of development of my thought process for implementing the build script, I considered providing the git branch as an input to the build script for some time, then switched to providing the git revision instead (which could belong to any branch). Now, as my knowledge is increasing further, I am again in favor of using git branch references.

  • How do you build from a specific TFS 2008 Changeset in Jenkins?
  • Automatically remove Subversion unversioned files
  • Git and incremental commit dates/number/something
  • Use custom NuGet feed in Visual Studio Online
  • Bumping version numbers for new releases in associated files (documentation)
  • Git hosting setup that pulls from developers, rejecting broken commits?
  • I would like to explore all the pros and cons of having either of these, which people have experienced, so that others have some reference to begin with.

    The latest problem with using revisions that I realized today is that, it seems, I will have to pull all the branches to local in order to be able to find the one containing the revision, so that I can then move the working directory to that revision. Check How to take local working directory to any git revision irrespective of its branch after remote changes?.

  • How to fix a git tracked file that is treated as untracked?
  • Automatically remove *.pyc files and otherwise-empty directories when I check out a new branch
  • Using path extension \\?\ for windows 7 with python script
  • Phpstorm Git file colors
  • How Do I Push an Existing Eclipse Project Up to Bitbucket With EGIT?
  • What does “Warning : There are multiple branch changesets here” mean?
  • One Solution collect form web for “Pros and cons of using git revisions instead of branches as references for rollouts”

    If you want to refer to a specific revision, create a tag. Tags are meant for things like identifying specific builds and released versions. A tag points to a specific commit just like a branch head does, but unlike a branch head, it doesn’t change as additional commits are added.

    Git Baby is a git and github fan, let's start git clone.