Skip to content

Instantly share code, notes, and snippets.

@alja
Last active November 13, 2015 19:19
Show Gist options
  • Save alja/78e599d3bb2d9c9d1ea7 to your computer and use it in GitHub Desktop.
Save alja/78e599d3bb2d9c9d1ea7 to your computer and use it in GitHub Desktop.
git_t&t
git clone -n https://github.com/cms-sw/cmssw src
cd src
git config core.sparsecheckout true
cat ~/fwlite_build_set | grep Fire > .git/info/sparse-checkout
checkout existing branch on my-cmssw
git clone -b calo2 -n https://github.com/alja/cmssw $CMSSW_BASE/src
cd $CMSSW_BASE/src
git config core.sparsecheckout true
cp ~/cms-dev/sparse-checkout $CMSSW_BASE/src/.git/info/sparse-checkout
git co calo2
create new branch from release and pus hit to my-cmssw
git cms-addpkg PhysicsTools/Configuration
git fetch official-cmssw imported-CVS-HEAD:imported-CVS-HEAD
git checkout imported-CVS-HEAD -- PhysicsTools/Configuration/test/SUSY_pattuple_cfg.py
git cms-addpkg DataFormats/TestObjects
git checkout -b my-new-feature
git push my-cmssw my-new-feature
undo last commit
git reset --hard HEAD~1
MEGE
git fetch official-cmssw CMSSW_6_2_X:CMSSW_6_2_X git fetch my-cmssw GEMDigi-62:GEMDigi-62 git merge CMSSW_6_2_X
git pull origin master ....
==========================================================
git stash
git stash applu
tags
After the clone, you can list the tags with git tag -l and then checkout a specific tag: git checkout tags/ git fetch --tags" works too – John Erck Oct 26 '12 at 20:37
git diff branch1..branch2
git diff --summary branch1..branch2 -- Fireworks
Updates: git rev-list --all | xargs git grep expression will work if you run into an "Argument list too long" error
git show <commit>
git log --pretty=format:"%h - %an, %ar : %s" -11 --reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment