Brief reference of various git commands. Also practice with git branching
git init
- Initialize a local git repo in working directorygit status
- show state of the local repogit log
- list commit historygit log --oneline
- Compact commit historygit config -l
- show your git configuration settingsgit commit -m "msg"
- commit work to local repo with commit message 'msg'
git branch
- list local branchesgit branch newBranch
- creates a new branchgit checkout newBranch
- switches to the branch specified
git remote add alias url
- addalias
as name for remote repourl
in project configurationgit push alias aBranch
- push local commits to remote repoalias
's branchaBranch
git pull alias aBranch
- pull remoteaBranch
fromalias
into current local branch