git config --global user.name "John
Doe"
git config --global user.email "johndoe@example.com"
git clone
git://github.com/schacon/grit.git
git clone git://github.com/schacon/grit.git mygrit
git init
git init --bare
git add |
git add |
git rm --cached |
git commit [-m "message"] |
git status |
git diff [--staged] |
# a comment this is ignored *.a # no .a files !lib.a # but do track lib.a /TODO # only ignore the root TODO file, not subdir/TODO build/ # ignore all files in the build/ directory doc/*.txt # ignore doc/notes.txt, but not doc/server/arch.txt
git log [-#] [-p]
[--stat]
git diff [<commit>] [--stat]
git diff <commit> <commit>
ex: git diff HEAD~2 HEAD
ex: git diff HEAD^
git push [<local branch>]
git push origin main
git pull [<remote branch>]
git pull origin/main
git branch testing
git branch testing
git switch testing
git switch testing
git branch iss53
git commit
git branch iss53
git commit
git switch main
git switch -c hotfix
git commit
git switch main
git switch -c hotfix
git commit
git switch main
git merge hotfix
git switch main
git merge hotfix
git branch -d hotfix
git switch iss53
git commit
git branch -d hotfix
git switch iss53
git commit
git switch main
git merge iss53
git switch main
git merge iss53
<<<<
, ----
, and
>>>>
git <command> --help
man git-<command>