Git Auto Completion and Some Log Commands

  • you should learn to use tab to show all git command. (Use Git Auto-Completion)

    Set Git Auto-Completion

    Auto-Completion
    If you use the Bash shell, Git comes with a nice auto-completion script you can enable.
    Download it directly from the Git source code at ‘https://github.com/git/git/blob/master/contrib/completion/git-completion.bash'.
    Copy this file to your home directory, and add this to your .bashrc file:
    1
    source ~/git-completion.bash

1. git log –[tab] :

  • Of course you can type anything, and tab tap to show commands.

2. Some log commands

  • some Insteresting commands
    1
    2
    3
    4
    5
    6
    $ git log --graph
    $ git log --oneline
    $ git log --max-count=4 (show 4 lastest commits)
    $ git log --stat
    $ git log --committer=haiyang
    $ git log --name-status