Tools - Git

Git Links

Installing Git

A developer learning to use eg/git should first review these slides from TUG 2009. The slides cover the basic set up for using eg/git, and provide a nice translation of CVS command to eg commands on slide 18.

To install git on your machine, see the Install eg/git link. After expanding the tarball, be sure to review the README file.

To get started with git, just install eg/git on your machine with the install-git.py script as:

   $ SOME_BASE_DIR/install-git.py --do-all \
     --install-dir=SOME_DIR
   $ export PATH=SOME_DIR/bin:$PATH

Once you have installed eg/git, you should do some configuration:

    $ eg config --global user.name "Your Name"
    $ eg config --global user.email youruserid@sandia.gov
    $ eg config --global color.ui true

One should consider creating a script to automate the setup of git on a new machine for example as shown at:

    $ ./sampleScripts/git-profiles/git-config-rabartl.sh

NOTE: Some useful eg log aliases can be installed using the command:

    $ ./commonTools/git/git-config-alias.sh

Some of the useful aliases installed include eg log-oneline, eg log-short, eg log-local and eg local-stat (see the file ~/.gitconfig for the other alias installed).

Using Git

Once you have installed and configured git, you are ready to clone the Trilinos git repository with:

   $ eg clone software.sandia.gov:/space/git/Trilinos

You can then change code, build, etc.

To ease the transition to git, you can use the checkin-test.py script described here to do all of the actions needed for a safe bullet-proof commit and push (i.e. no staging area issues, no "non-fast forward" error messages, and no merge commits to deal with).

A few notes:

  • The easiest way to get the new repository is: eg clone software.sandia.gov:/space/git/Trilinos
  • The documentation for git can be found here (eg/git cheat sheet).
  • Please do the initial setup described in the "Initial Setup" section of here so that your name and email are correct for commits.
  • To merge changes that you may have in existing CVS projects (taken from page 7 of this presentation):
    • Download: scp software.sandia.gov:/space/git/temp/merge-cvs-changes.py .
    • From within a clone of the Trilinos git repository, run: merge-cvs-changes.py /path/to/Trilinos/cvs/checkout
  • The remaining Trilinos repositories such as TrilinosWeb, TrilinosData, etc. have not been converted to git yet and are still CVS repositories.

If you have issues, comments, concerns please send them to Brent (bmpersc@sandia.gov) and cc the Trilinos Framework list (trilinos-framework@software.sandia.gov).