clone:
git clone git@10.1.100.100:kernel_imx
add:
git add .
push:
git status
git commit -a -m "message"
git push origin master
pull:
git pull
checkout:
git checkout <file>
git checkout <commit-hash-id> <file>
show commit:
git show <commit-hash-id>
git show --name-only <commit-hash-id>
log:
git log
git log -p <filename> //check the patch history of the file
git log <filename> //check the modification history of the file
git log --stat
diff:
git diff
git diff -- "*.c" "*.h"
tag:
//show tag
git tag
//create tag
git tag V1.2
git push origin V1.2
//delete tag
git tag -d V1.2
git push origin :refs/tags/V1.2
//checkout tag
git checkout V1.2
branch:
//create branch
git branch setp240_mcu
//switch branch
git checkout setp240_mcu
//push
git push origin <branch>
//pull
git branch --set-upstream-to=origin/setp240_mcu setp240_mcu
git pull
patch:
git format-patch -1 <r1> //generate patch of commit id