<div>Hi Ben,</div><div><br></div>As a developer, I use the following git commands each and every day. These are in no particular order:<div>git grep <pattern></div><div>git checkout -b foo <remote>/<branch></div>
<div><meta http-equiv="content-type" content="text/html; charset=utf-8">git checkout <remote>/<branch></div><div>git checkout <commit></div><div>git add <path></div><div>git add -pi <path></div>
<div>git rebase</div><div>git rebase -i HEAD~5</div><div>git merge</div><div>git cherry-pick <commit></div><div>git log</div><div>git log -p</div><div>git log -p -1</div><div>git log -p -1 <commit></div><div>git reset HEAD~1 (to unstage commits when editing commits with git rebase -i HEAD~x)</div>
<div>git clean -df (use with care)</div><div>git commit --amend</div><div>git commit</div><div>git blame</div><div>git fetch</div><div>git push</div><div>git status</div><div>git tag -s <tagname> (I always sign my tags)</div>
<div><br></div><div>I use each and everyone one of these pretty much *every* day.</div><div><br></div><div>I also have the following aliases which make life easy. These are listed in order of frequency of use:</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">git st = git status</div>
<div>git co = git checkout</div><div>git br = git branch</div><div>git wdiff = git diff --color-words</div><div>git stdel = !git st | grep delete | awk '{print $3}' | xargs git rm</div><div><br></div><div>And the following commands are also really useful from time to time:</div>
<div>git bisect (to find when a bug began it's existence - very useful)</div><div>git gc (improves the speed of busy repositories by compressing the repo, and removing dangling links)</div><div>git map (Perl version: <a href="https://github.com/clarkema/git-map">https://github.com/clarkema/git-map</a>; bash version: <a href="https://github.com/icefox/git-map">https://github.com/icefox/git-map</a>. Allows you to check the status of multiple git repos easily)</div>
<div>git remote add <name> <url></div><div>git mv</div><div>gitk --all (I never use it without --all)</div><div>git show <branch>:<path></div><div>git vimdiff (alias to !GIT_EXTERNAL_DIFF='gitvimdiff' git --no-pager diff "$@" where gitvimdiff is a bash script in my $PATH running exec vimdiff "$2" "$5")</div>
<div>tig --all (I never use it without --all)</div><div>git reflog</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>I personally don't like git pull</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<br></div><div>There are also tools like gerrit which are brilliant - you can see how we use it in the mahara project at <a href="https://reviews.mahara.org">https://reviews.mahara.org</a>. We also have Jenkins (continuous integration) hooked in to run various tests which feed into the process and prevent submission of commits to the repo if there are errors.</div>
<div><br></div><div>I use git in the following situations daily:</div><div>* as a contributor on the moodle project (<a href="http://www.moodle.org">http://www.moodle.org</a>) - an open source virtual learning environment written in php;</div>
<div><meta http-equiv="content-type" content="text/html; charset=utf-8">* as a contributor on the mahara project (<a href="http://www.mahara.org">http://www.mahara.org</a>) - an open source ePortfolio application written in php;</div>
<div>* as a systems developer to manage our configuration management system (git/puppet/perl/template toolkit/other custom tools);</div><div>* for storage of debian package sources for packages we write/build/maintain; and</div>
<div><meta http-equiv="content-type" content="text/html; charset=utf-8">* for internal projects.</div><div><br></div><div>And also frequently:</div><div>* as a debian package maintainer for mahara;</div><div>* for texinfo documents;</div>
<div>* for latex documents;</div><div>* ...</div><div><br></div><div>I also have a custom .bashrc snippet which displays my current branch if I'm in a repository, and colours this according to status (red = dirty; yellow = on master and clean; green = on another branch and clean) which is really handy. You'll find it at ~nicols/.bashrc on <a href="http://login.opencsw.org">login.opencsw.org</a> if you're interested.</div>
<div><br></div><div>Hope that this helps,</div><div><br></div><div>Andrew</div><div><br><div class="gmail_quote">On 16 August 2011 02:18, Ben Walton <span dir="ltr"><<a href="mailto:bwalton@opencsw.org">bwalton@opencsw.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Hi All,<br>
<br>
I'm going to be putting together a git presentation for a mostly<br>
technical audience. I expect that most of these folks will not have<br>
used git although a few will have. I'm curious what those of you who<br>
use git would present. What features do you:<br>
<br>
find most useful?<br>
find hardest to understand?<br>
wish you'd learned earlier?<br>
find most dangerous?<br>
<br>
Thanks<br>
-Ben<br>
--<br>
Ben Walton<br>
Systems Programmer - CHASS<br>
University of Toronto<br>
C:<a href="tel:416.407.5610" value="+14164075610">416.407.5610</a> | W:<a href="tel:416.978.4302" value="+14169784302">416.978.4302</a><br>
<br>
_______________________________________________<br>
maintainers mailing list<br>
<a href="mailto:maintainers@lists.opencsw.org">maintainers@lists.opencsw.org</a><br>
<a href="https://lists.opencsw.org/mailman/listinfo/maintainers" target="_blank">https://lists.opencsw.org/mailman/listinfo/maintainers</a><br>
.:: This mailing list's archive is public. ::.<br>
</blockquote></div><br><br clear="all"><br>-- <br>Systems Developer<br><br>e: <a href="mailto:andrew.nicols@luns.net.uk" target="_blank">andrew.nicols@luns.net.uk</a><br>im: <a href="mailto:a.nicols@jabber.lancs.ac.uk" target="_blank">a.nicols@jabber.lancs.ac.uk</a><br>
t: +44 (0)1524 5 10147<br><br>Lancaster University Network Services is a limited company registered in<br>England and Wales. Registered number: 04311892. Registered office:<br>University House, Lancaster University, Lancaster, LA1 4YW<br>
<br>
</div>