Some git instructions

How to install git?

Source code and User Guide available in
At lxplus one can use the available binary by
source /afs/

Introducing oneself to git:

git config --global "Your Name Comes Here"
git config --global

Useful git commands:

git clone
git commit -a // committing changes to existing files only
git add file; git commit // adding and committing a new file
git rm file; git commit // removing a file and committing
git remote add public ${HOME}/public/html/HiggsAnalysis.git
git remote add public ssh://
git remote add public ssh://
git remote add public ssh:// git push public refs/heads/master:refs/heads/master
git tag -l
git push --tags public
git diff HEAD^ HEAD
git checkout file // git revert
git checkout HEAD~n file // git revert file from HEAD-n commits
git checkout tags/pre2017 -b pre2017 // checkout a tag git branch --track branch origin/branch
git push public :refs/heads/pattuplev26 // delete remote branch

Problems getting the clone due to SSL authentication:

git config --global http.sslVerify false

How to make a public repository (to be done before "git remote add" command):

cd $HOME/public/html
mkdir HiggsAnalysis.git
cd HiggsAnalysis.git
git --bare init
mv hooks/post-update.sample hooks/post-update
git update-server-info

Taking code from others:

git remote add matti
git fetch matti
git merge matti/master


Last change on January 29, 2009 by S. Lehti.