Last updated 7/June/2012 I don't think any of these ideas are originally mine and I apologise that I do no longer have the correct information to credit the appropriate people. This is my place to put some of the tips and tricks I come across when using Git. There are of course lots of other places on the inter tubes that provide better tips. These are just mine and I'll update this over time
  1. Before making the first commit to a repo check the email address (git config --get user.email) and if needed set the email address to different value on the repo  by omitting the --global option to the command git config user.email myhandle@cool.com)
  2. Set up a global .gitignore file to be used by all repos
    1. Create a file ~/.gitignore with some useful exclusions (e.g. the backup files for your editor or .DS_Store on OS/X)
    2. run the command git config --global core.excludesfile ~/.gitignore
  3. Help Window users and yourself by running git config --global core.autocrlf input (see GitHub help), but beware of lots of apparent line ending changes after setting this , these are benign.
  4. Keep a copy of this handy picture around as an aide-memoirGit data transport commands
  5. Get a public Git repo account. My favourite is GitHub, other options include Gitorious and BitBucket
  6. Would you like the git help text to appear in a browser. Run git config --global help.format web. N.B. Needs the html version of the Git documents installed. Don't like the default browser? Run git config --global web.browser chromium
  7. Using https instead of git as your transport protocol? You can now use various helper programs to cache your https credentials. The GitHub setup help page has details for each platform
  8. Install the BFG jar file and then add a bfg alias to git. git config --global alias.bfg '!java -jar ~/bin/bfg.jar' with the correct path and name for your jar
Using Git from Bash?
  1. Add the following to your ~/.bashrc file NB file locations correct for Ubuntu Linux 9.10 and Cygwin ``` bash # enable git programmable completion features if [ -f /etc/bash_completion.d/git ]; then . /etc/bash_completion.d/git PS1='\[\e]0;\u@\h: a\]${debian_chroot:+($debian_chroot)}\u@\h:\w \$(__git_ps1 \' (%s)\')$' fi ``` On Cygwin try PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '. If you cannot locate the bash completions file on your system then you can get a copy from the Git source tree
  2. If you prefer to use gvim for your commit messages then add the following to .bashrc (NB You c set this in ~/.gitconfig if you prefer git config --global core.editor=....) export GIT_EDITOR="/usr/bin/gvim --nofork". See below for more Vim tips
Using Git on Ubuntu GNU/Linux? Ubuntu users should add the Git PPA to their sources so that they get Git updates and new releases. KDiff3 is available for Windows (handy for diffs and merges) Using Git from Vim? -- see the Vim Git tips