configuring git

Some useful git configurations to candy eye it:

  • Email and username:
git config --global user.name "My Name"
git config --global user.email my@email.com
  • Aliases:
git config --global alias.st status
  • Colors:
git config --global color.branch ?auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto
  • Editor:
git config --global core.editor emacs

Setting up the shell to show which branch you are using. Just add this line into your .bashrc:

export PS1="\w \`ruby -e "print (%x{git branch 2> /dev/null}.lines
.grep(/^\*/).first ||'').gsub(/^\* (.+)$/, '(\1) ')"\`\[\033[37m\]$ "

Don’t forget to install ruby in order to get it working.

This entry was posted in any and tagged . Bookmark the permalink.

One Response to configuring git

  1. Thiago Bueno says:

    Pretty cool!!

    Thanks, dude!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>