[cmake-developers] How to follow the developpement of a CMake branch with git?

Brad King brad.king at kitware.com
Fri Mar 5 08:07:44 EST 2010


Eric Noulard wrote:
> How do I do that with git?
> I cannot find this on:
> http://www.cmake.org/Wiki/CMake/Git

The "Resources" linked at the bottom of the page have lots more info.

> after cloning, "git branch" does not tell me anything (which is ok)
> "git tag" list me available tags:
> v2.4.0
> ....
> v2.8.0
> 
> so I can checkout and/or create a new [local] branch based on thoses
> tags but how

Use

  $ git branch -r

to see remote branches.

> but how can I setup-up my tree to point to v2.8.1-rcLATEST?
> (and make later git pull take me forward along this branch?)

Quick answer:

  $ git checkout -b release origin/release
  Branch release set up to track remote branch release from origin.

or for a new clone and git 1.6.5 or higher:

  $ git clone -b release git://cmake.org/cmake.git CMake

Informative answer:

  $ git branch
  * master
  $ git branch -r
    origin/HEAD -> origin/master
    origin/master
    origin/nightly
    origin/release
  $ git branch --track release origin/release
  Branch release set up to track remote branch release from origin.
  $ git checkout release

A "tracking" branch is just a local branch that has a couple
configuration entries:

  $ cat .git/config
  ...
  [branch "release"]
        remote = origin
        merge = refs/heads/release

You can read them with the "git config" command too:

  $ git config branch.release.remote
  origin
  $ git config branch.release.merge
  refs/heads/release

-Brad


More information about the cmake-developers mailing list