Friday, January 23, 2009

git cheat sheat

Found some nice cheat-sheets for git:
To set the user and e-mail used when making a commit to your git repo, use:

git config user.name 'John Doe'
git config user.email johndoe@example.com

If you are using gitorious, you might find handy to use an alternate ssh key made specifically for gitorious upload. You could make such a key with:

ssh-keygen -b 4096 -C johndoe@example.com

Save the key under ~/.ssh/id_rsa_johndoe_example_com and modify ~/.ssh/config to:

Host gitorious
Hostname=gitorious.org
IdentityFile=~/.ssh/id_rsa_johndoe_example_com

Upload the public key to gitorious. After that, you'll be able to use the new key to push your changes to gitorious using the id_rsa_johndoe_example_com key.

Another very useful setting for using git with CMake is to add the build/ dir into your .git/info/exclude file so that git status ignores all build files.

No comments:

Post a Comment