It is more mature and feature-rich, compared to gitx. But it is closed source. However, it is free (as in beer) for the time being in the App Store. So far, the program seems really nice. Let’s see how long I will continue using it, and if I’ll go back to gitx at some point.
Category: git
Even better gitx with push/pull support
Switching the active branch in a bare git repository
If you ever need to delete the “active” branch in a git repository, you need to first switch the active branch. Because you cannot delete the branch you are sitting on… You cannot checkout a branch, as you would usually do. You have to change the symbolic reference called HEAD. You can do this with the symbolic-ref command:
$ git branch
* deletethis
somebranch
$ git symbolic-ref HEAD refs/heads/somebranch
$ git branch
deletethis
* somebranch
$ git branch -d deletethis
Setting the sender of git post-receive hooks
#!/bin/sh
# Use the name and email address of the author of the last commit.
USER_EMAIL=$(git log -1 --format=format:%ae HEAD)
USER_NAME=$(git log -1 --format=format:%an HEAD)
. $(dirname $0)/post-receive-email
I then also changed the default post-receive-email script, to look like this in the send_mail() function:
send_mail()
{
if [ -n "$envelopesender" ]; then
/usr/sbin/sendmail -t -f "$envelopesender"
else
/usr/sbin/sendmail -t -F "$USER_NAME" -f "$USER_EMAIL"
fi
}
gitx with push / pull support
I love gitx, the git GUI for OS X. However, it used to have no push / pull support. Which is pretty important for git. But git and github are beautiful pieces of software. So there is another fork on github, containing push / pull support and more. This little context menu made me happy:
How to set up git email notifications
This is not very well documented in the git user manual. Here is what I did:
Go to your central repository, not your working copy. There, change to the hooks directory:
cd /path/to/yourproject/hooks
cp post-receive.sample post-receive
git config hooks.mailinglist “email1@bla.com, email2@bla.com”
git config hooks.envelopesender yourname@informatik.rwth-aachen.de
git config hooks.emailprefix “New commit: “
Also you should give your project a name:
$EDITOR /path/to/yourproject/description