Getting started with git

Configure your prompt

You need to install a proper git environment. Add this code in your .bashrc file:

source ~/.git-completion.sh

GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWUPSTREAM="auto git"

PS1='\u@\h:\w$(__git_ps1 "(%s)")\$ '

Here is the .git-completion.sh

Configure your .gitconfig

[user]
    name = <your_name>
    email = <your_email>
    signingkey =  <your_email>

[alias]
    ci = commit
    st = status
    br = branch
    co = checkout
    sw = checkout @{-1}
    lo = log --oneline
    hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
    type = cat-file -t
    dump = cat-file -p
    unstage = reset HEAD

[color]
    interactive = auto

[pull]
    rebase = true
[push]
    default = simple

[http]
    postBuffer = 524288000
[core]
    pager = less -R