Recommended: git-completion.bash

If you use git on a daily basis like I do, git-completion.bash is a great way to make your life a little easier. While I guess it does add tab-completion for git commands, the most useful feature for me is the ability to put the current branch into the cmdline prompt. Now that I am comfortable working with multiple git branches and remotes, a little reminder where I am prevents time-consuming mistakes. git-completion.bash lives in git's git tree.

  1. git clone git://git.kernel.org/pub/scm/git/git.git
  2. copy git/contrib/completion/git-completion.bash to ~/.git-completion.sh
  3. Follow the instructions in the file to set up, and enable showing branch in $PS1
I also use this alias in my ~/.gitconfig, which is convenient:
[alias]
        log1 = log --pretty=oneline --abbrev-commit

Have fun!

Comments:

I use logs = log --stat pretty often, too.

Posted by Stefan on December 13, 2010 at 05:31 AM PST #

Nice, I like it!

Posted by Andy Grover on December 13, 2010 at 06:37 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Andy Grover's work blog.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today