Using the Git repository¶
- Table of contents
- Using the Git repository
- Checking out the code
- Keeping up to date with the FNAL repository
- Help with git
You need to have a valid kerberos ticket and one that has forwarding obtained via:
kinit -f username@FNAL.GOV
and you should see flags "FRIA" e.g.
Credentials cache: API:501:1 Principal: lmark@FNAL.GOV Issued Expires Flags Principal Sep 13 16:05:12 2013 Sep 14 18:05:11 2013 FRIA krbtgt/FNAL.GOV@FNAL.GOV
You may also need to tweak your ssh configuration, depending on your system's default ssh configuration, by adding
Host cdcvs.fnal.gov HostName cdcvs.fnal.gov GSSAPIAuthentication yes ForwardX11Trusted no GSSAPIDelegateCredentials yes
into your ~/.ssh/config file.
If ssh and kerberos are working then you should be able to type:
ssh email@example.com echo hello
and then get back the statement "Only 'lscvs' and 'cvs' commands are allowed".
Although I have had instances where this fails yet the git communication with FNAL is OK.
Checking out the code¶
You can get a local copy of the git repository via the command:
git clone ssh://firstname.lastname@example.org/cvs/projects/gm2trackerdaq
This takes a while (a few mins "Resolving deltas").
Then do the following (you need only do this once) :
cd gm2trackerdaq git config --global user.name "Your name" git config --global user.email email@example.com
You then need to switch to the correct branch, which is currently productionDAQ (this will be merged into develop soon).
cd gm2trackerdaq git checkout productionDAQ
Keeping up to date with the FNAL repository¶
Update your local repository from the FNAL remote version as follows:
git pull origin productionDAQ
Push your committed changes to the FNAL remote repository using:
git push origin productionDAQ
Help with git¶
See these pages for g-2 specific git info:
There are also many guides online.
Issues connecting to repository¶
If you get permission denied errors when trying to access the git repository, first check you have a valid kerberos ticket using klist -a. If you have and it still doesn't work, you may have an issue resolving the DNS alias in the FNAL git server from cdcvs.fnal.gov (the alias) to ccdcvsvm.fnal.gov (the real hostname). A work around for this is to directly use ccdcvsvm as your remote server.
To do this at the initial clone:
git clone ssh://firstname.lastname@example.org/cvs/projects/gm2trackerdaq
In this case you should then be able to push/pull as normal (e.g. as covered above).
If you have an existing repository already cloned using cdcvs, you can add an additional remote server:
git remote add origin-no-dns ssh://email@example.com/cvs/projects/gm2trackerdaq
You can then push/pull using:
git pull origin-no-dns <your branch> git push origin-no-dns <your branch>