[csw-maintainers] [offtopic] git presentation

Andrew Robert Nicols andrew.nicols at luns.net.uk
Tue Aug 16 11:23:06 CEST 2011


Hi Ben,

As a developer, I use the following git commands each and every day. These
are in no particular order:
git grep <pattern>
git checkout -b foo <remote>/<branch>
git checkout <remote>/<branch>
git checkout <commit>
git add <path>
git add -pi <path>
git rebase
git rebase -i HEAD~5
git merge
git cherry-pick <commit>
git log
git log -p
git log -p -1
git log -p -1 <commit>
git reset HEAD~1 (to unstage commits when editing commits with git rebase -i
HEAD~x)
git clean -df (use with care)
git commit --amend
git commit
git blame
git fetch
git push
git status
git tag -s <tagname> (I always sign my tags)

I use each and everyone one of these pretty much *every* day.

I also have the following aliases which make life easy. These are listed in
order of frequency of use:
git st = git status
git co = git checkout
git br = git branch
git wdiff = git diff --color-words
git stdel = !git st | grep delete | awk '{print $3}' | xargs git rm

And the following commands are also really useful from time to time:
git bisect (to find when a bug began it's existence - very useful)
git gc (improves the speed of busy repositories by compressing the repo, and
removing dangling links)
git map (Perl version: https://github.com/clarkema/git-map; bash version:
https://github.com/icefox/git-map. Allows you to check the status of
multiple git repos easily)
git remote add <name> <url>
git mv
gitk --all (I never use it without --all)
git show <branch>:<path>
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")
tig --all (I never use it without --all)
git reflog

I personally don't like git pull

There are also tools like gerrit which are brilliant - you can see how we
use it in the mahara project at https://reviews.mahara.org. 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.

I use git in the following situations daily:
* as a contributor on the moodle project (http://www.moodle.org) - an open
source virtual learning environment written in php;
* as a contributor on the mahara project (http://www.mahara.org) - an open
source ePortfolio application written in php;
* as a systems developer to manage our configuration management system
(git/puppet/perl/template toolkit/other custom tools);
* for storage of debian package sources for packages we
write/build/maintain; and
* for internal projects.

And also frequently:
* as a debian package maintainer for mahara;
* for texinfo documents;
* for latex documents;
* ...

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 login.opencsw.org if you're
interested.

Hope that this helps,

Andrew

On 16 August 2011 02:18, Ben Walton <bwalton at opencsw.org> wrote:

>
> Hi All,
>
> I'm going to be putting together a git presentation for a mostly
> technical audience.  I expect that most of these folks will not have
> used git although a few will have.  I'm curious what those of you who
> use git would present.  What features do you:
>
> find most useful?
> find hardest to understand?
> wish you'd learned earlier?
> find most dangerous?
>
> Thanks
> -Ben
> --
> Ben Walton
> Systems Programmer - CHASS
> University of Toronto
> C:416.407.5610 | W:416.978.4302
>
> _______________________________________________
> maintainers mailing list
> maintainers at lists.opencsw.org
> https://lists.opencsw.org/mailman/listinfo/maintainers
> .:: This mailing list's archive is public. ::.
>



-- 
Systems Developer

e: andrew.nicols at luns.net.uk
im: a.nicols at jabber.lancs.ac.uk
t: +44 (0)1524 5 10147

Lancaster University Network Services is a limited company registered in
England and Wales. Registered number: 04311892. Registered office:
University House, Lancaster University, Lancaster, LA1 4YW
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencsw.org/pipermail/maintainers/attachments/20110816/876664ae/attachment-0001.html>


More information about the maintainers mailing list