Two Git tips
Following the Git tips being thrown on Planet Debian, here's a couple:
1. Changing into a directory that contains a repo and shows you on PS1 what branch you are standing on:
On .bashrc I have:
GITPS1='$(__git_ps1 ":%s ")'
export PS1="${GREEN}\w${RS} ${YELLOW}${GITPS1}${RS}\\$ "
2. An alias I like to use on repos that are personal for quick tracking:
[alias] ... log1 = log --pretty=oneline --abbrev-commit
I hope you like them.





The first tip doesn't work so well if you keep your home directory in .git, because then it'll always show a branch.
Anonymous
13 Dec 08 at 4:34 am
First, I don't know someone so brave to have the whole directory on Git, at least on a RL workstation.
And if so, you can use this variation of the tip:
http://git.pastebin.com/m6e55831c
admin
13 Dec 08 at 10:40 am
Thanks for the follow-up, I do have my homedir in git and your "__maybe_git_ps1" function works fine.
Francois
14 Dec 08 at 2:25 am
[...] Git is becoming my main util for Debian packaging, as I am using it to keep my work on packages I maintain alone or in a team by using git.debian.org facilities. I am not still usign tools like TopGit to keep patches, by I also intend to do so in a near future. What does git give me over svn? Basically two things: branches and having the whole source code at hand. The first is obvious, I can easily create branches to experiment without having to change anything in the way the package is, so if a new upstream release occurs in the time it takes me to implement some change (and that usually happens) I can upload it straight, not affecting my undergoing changes. Also I appreciate having the whole source code. This could have been also done using svn, but we preferred not to do so, and most packages only have debian dir in their svn repositories. This makes harder work with upstream sources, where they need to be patched. Git provides me the way to have always an upstream source code copy at hand, and the branch power can also be applied to it. But I wanted to write about a couple of git tips that I found. Seems that they have already appeared on Planet Debian before, but I think that is not a bad idea to remember them (from damog's blog): [...]
Git tips | Tribulaciones.org
25 Dec 08 at 1:58 pm
Hi David, I'm here now, thanks for your comment in my blog, I like your tip 2, going to put into my aliases.
Regards.
Jose Castaneyra
26 May 09 at 9:50 am