----------------------------------------------------
Phil's GIT command line cheat sheet, edit 4-06-2017
----------------------------------------------------

*** git-idscript, see:
http://cadswes2.colorado.edu/~philw/2012/git/git-idscript/README1-2012-may-10.html
http://cadswes2.colorado.edu/~philw/2012/git/git-idscript/ 
[Alamosa] /data/home/staff/philw/public_html/2012/git/git-idscript/ 

*** Create a local repository
git clone /data/projects/riverware/builds.git AlamPhilDev 
git clone /data/projects/riverware/builds-rt.git AlamRT 
git clone /data/projects/riverware/CodeExamples.git AlamCodeExamples 
git clone /data/projects/StudyMgr/StudyMgr.git StudyMgr 

git clone ssh://git@stash.int.colorado.edu:7999/cad/riverware.git AlamBbTest1

*** General
git fetch origin

*** Checkout and track remote branch
git checkout -b PhilDev origin/PhilDev 
git checkout -b TeacupDev origin/TeacupDev 

*** Show which branch I'm on.
git branch

*** Show changed files and stuff
git status

*** Switch to local branch
git checkout TeacupDev

*** Erase local changes
git checkout <filename>

*** Stash, pop, drop all changes.
git stash
git stash pop
git stash drop

*** Pull changes from remote (only after erasing or stashing local changes)
git pull

*** Diff local changes
git diff --color
git diff --name-only
git diff --numstat
git diff --stat

*** Search commits
git log --grep=<pattern>

*** Show files changed in last commit in branch
git show --name-only --oneline HEAD

*** Abort a failed merge
git reset --merge

*** List Phil's branches (most useful in origin, e.g. builds.git)
git for-each-ref --format='%(authorname) %09 %(refname)' | grep heads | grep philw 

-----------------
OTHER: gnats path on Alamosa:
cd /usr/local/gnats/com/RiverWare/

-----------------
Qt5 qmake cleanup SED script:
sed -i -b 's|C:/[Rr]iverware/staff/[A-Za-z0-9]*/[A-Za-z0-9]*/\([A-Za-z0-9]*\)|"../\1"|g' */*.vcxproj

---