In the case you want to use git you should read:
http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html git tutorial, HIGHLY, recommended
http://www.kernel.org/pub/software/scm/git/docs/everyday.html everyday git, for the daily work
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html git user manual, if you want to know everything
http://www.loria.fr/~molli/pmwiki/pmwiki.php/Main/See here you can find a pdf version of the user manual
getting ILC-Soft SVN into your personal git
Recently, many of the ILC-Soft CVS repositories have been converted to SVN repositories. You can use following procedure to import these SVN repositories:
# go to an empty directory for the new git repo cd <my place> flcini git flcini svn git svn clone -s http://svnsrv.desy.de/public/lccd/lccd lccd
Unfortunately, git-svn has to be installed by hand to the latest git version. Therefore, only the current version 1.6.3 supports this. Also there is currently no ssl support. Therefore, https: (which is shown in the ILCSoft example) has to be replaced by http:
getting ILC-Soft CVS into your personal git
ILCsoft/CALICE still uses the over aged CVS for archiving some of their software. Additionally, they use some non standard version which prevents to clone it into a git repository with standard tools. You need a special version of ccvssh_git to import these CVS repositories. Following procedure works:
# go to an empty directory for the new git repo cd <my place> # login details export CVSROOT=:ext:anonymous@cvssrv.ifh.de:/marlin # special version of CVSSSH export CVS_RSH=/group/hcal/calice_soft/tools/bin/ccvssh_git # login (password should be empty, should give ok as reply) $CVS_RSH login git cvsimport -v -r cvs Marlin
Some usecases how to use git for our software development:
Select patches for upload to the pro branch
- bring your current git HEAD in a clean state
( check in all your changes, use git-stash or work on a clean repository and import your repository as a remote )
be sure your repository in in sync with with the latest HEAD ( see git-fetch, git-pull or git-remote update )
the cherry-pick method
- create a new branch starting with the latest pro
git checkout -b proupload pro
use gitk --all or git log or git show-branch to find the SHA1s of your commits you want to select (you only need the first few digits of the SHA1)
- apply the selected commits to your new branch by using
{{{ git cherry-pick d4af349 <- your SHA1
- create a new branch starting with the latest pro
git cherry-pick e21ca4 ...}}}
the rebase method (recommended)
you can abuse git-rebase to emulate the method above
- create a new branch starting with your development branch
git checkout -b proupload HEAD
- start an interactive rebase to rebase your changes upon the latest pro (or pro_test)
git rebase -i origin/pro
- this will open an editor. You can delete commits, merge commits into one or stop after a commit for editing of a commit before continuing
- when you close your editor, the rebase process starts.
if the rebase process stops because of a conflict or because you choose edit for one commit, edit the code and carry on by typing git rebase --continue. If you are lost type git rebase --abort and try again
- create a new branch starting with your development branch
the pick file method
- if you don't have "clean" commits, which you want to select for uploading into pro, you could try this
- select the files which changes you want to track
- create a patchset, which contains the changes of this file:
git log --pretty=email --reverse -p pro..HEAD calice-reco/src/myfile1.cc calice-reco/include/myfile1.hh >/tmp/myPatch.patch
create a new branch starting with the latest pro branch git checkout -b proupload pro
- apply your patchset to this new branch:
cat /tmp/myPatch.patch|git-am
- if you don't have "clean" commits, which you want to select for uploading into pro, you could try this
don't forget to test you new branch before asking somebody to pull this branch
- good luck
