Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Fairly new to Git. I recently updated it on my Mac. I upgraded using these 4 commands:

$ git clone git://git.kernel.org/pub/scm/git/git.git
$ cd git
$ make prefix=/usr/local all
$ sudo make prefix=/usr/local install

$ git --version
git version 1.7.3.2.164.g6f10c

my old version of Git was simply: 1.7.1.x

Do I have a pre-release build? If so how can I use git, itself, to checkout the most recent stable build? git branch -a gets me:

$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/html
  remotes/origin/maint
  remotes/origin/man
  remotes/origin/master
  remotes/origin/next
  remotes/origin/pu
  remotes/origin/todo
share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

I think this breaks down as follows:

The version of git you're running is one that has had 164 commits since version 1.7.3.2. The exact git revision number begins with the prefix g6f10c (these 6 digits should be enough to uniquely identify the commit if you need to refer to that revision in particular).

You can see released versions by running git tag and you can get version 1.7.3.2 exactly by running git checkout v1.7.3.2.

share|improve this answer
    
thank you! this sounds like it'll work. sorry for Git unfamiliarity. So after git checkout v1.7.3.2 i then checked the local branches with git branch and I see the master and * (no branch). i was expecting to see master and * 1.7.3.2. say i walk away from this project for a few weeks and come back. how can i tell what version is currently in my local repository? –  Meltemi Nov 12 '10 at 19:35
1  
@Meltemi tags are different from branches. Branches are intended to follow concurrent directions of development, so git remembers that you're on a particular branch, and allows you to commit new changes to the branch. A tag is a snapshot of a particular version at a particular point in time, so the running git branch will say you're on (no branch). To know what version is currently in your repository, git checkout master, and run git describe. It will give you a version number that breaks down like I described here. –  Ken Bloom Nov 12 '10 at 19:41
    
I wasn't familiar with git describe. i just ran it on my local repository and it came back with v1.7.3.2 which is what i was expecting. Thank you! So, last question: is * (no branch) normal? or do I want to somehow name it? or should I just build and install and then delete this (no branch)? seems weird, to me, to have active branch name (no branch) lingering around on my machine... I really don't want to keep dev builds on my machine. just want to understand a workflow for using git to get its own source and then build/install it... –  Meltemi Nov 12 '10 at 19:49
    
(no branch) is normal when you've checked out a tag. It means you're not on a branch and you can't commit. To get a better idea what's going on, look at Understanding Git Conceptually. After you've read about heads, there's only one detail to add: a branch is a head that moves frequently, and a tag is a head that doesn't (ordinarily) move. –  Ken Bloom Nov 12 '10 at 20:29
add comment

It is perfectly reasonable to consider the tip of git.git’s master stable.

From Documentation/howto/maintain-git.txt:

The tip of 'master' is meant to be more stable than any tagged releases, and the users are encouraged to follow it.

Before a new feature is ever merged into master, it is reviewed on the mailing list and “cooked” (often for several weeks) in the pu and next branches that the developers regularly test and use.

Git’s version numbers work like this:

      o----- major release: 1.7
     / o---- feature release: 1.7.3
    / / o--- maintenance release: 1.7.3.2
   / / /
1.7.3.2

Major releases often contain incompatible changes. Feature releases introduce new features. Maintenance releases contain bugfixes.

master is almost literally a merge of the latest maintenance release and the current accumulated features for the next feature release.

The output of git --version is based on the output of git describe on the commit that was used to build the binary (see GIT-VERSION-GEN).

The output from git describe adds extra information to better “nail down” the specific version when you are based on a commit that is not explicitly tagged.

         o------------- most recent reachable tag: 1.7.3.2
        /          o--- 'g' + abbreviated object name of built commit: 6f10c
       /          /
1.7.3.2.164.g6f10c
           \
            o---------- number of commits in built commit "on top" of tag: 164
share|improve this answer
add comment

As of today, 1.7.3.2 is the latest stable version available via http://git-scm.com/ What makes you question if you have the latest?

share|improve this answer
1  
Because he got his version of git from git's git repository where they do active development on the master branch. –  Ken Bloom Nov 12 '10 at 19:23
3  
@Ken: git.git’s master is hardly “active development”. Changes to git.git are reviewed on the mailing list, “cooked” in the pu branch, if they are sane they graduate to the next branch and they gradually are merged down into master. master also gets all the bugfixes from maint right away. “The tip of master is meant to be more stable than any tagged releases”. –  Chris Johnsen Nov 12 '10 at 22:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.