1. git init
2 . git add file
git commit -m "message"
3. git log
git log --graph --pretty=oneline --abbrev-commit
4. git reflog
5. git reset --hard HEAD^
git reset --hard ******
6. git checkout -- file
git reset HAED file
7. git rm file
8. github
2) set github.com ssh-key
3) ssh-agent -s
4) ssh-add key
9. git remote add origin git@server-name:path/repo-name.git
10. git push -u origin master || git push origin master 上傳至github的master庫
11. git clone git@github.com:grushy/test.git
12 . 查看分支:git branch
建立分支:git branch name
切換分支:git checkout name
建立+切換分支:git checkout -b name
合併某分支到當前分支:git merge name
刪除分支:git branch -d name
14. git stash 保存現場
命令git push origin tagname能夠推送一個本地標籤;
命令git push origin --tags能夠推送所有未推送過的本地標籤;
命令git tag -d tagname能夠刪除一個本地標籤;
命令git push origin :refs/tags/tagname能夠刪除一個遠程標籤。