setting up and using git

Install git

sudo apt-get install git

Setup git

You need to configure you git installation with your username and email. This email is atttached to every commit you make git config --global user.email "youremail@provider.com and git config --global user.name "user name"

Play around with git

git immersion

Cheat a little

The best way to learn git commands is to use them frequently and a cheat sheet can help with that. Here’s a github repo with one that you can download in pdf

Add aliases:

Once you get the hang of git commands you will find it easier to use short-hand commands instead of typing the whole line. You can modify your .bashrc if you use bash, .zshrc if you fancy zsh or modify your .gitconfig file which is neautral to both Immersion lab-11 has more on the same.

alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias go='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
alias got='git '
alias get='git '

End of story