$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
$ git init
$ pwd
$ git add 文件名
$ git commit -m "提交說明"
- 查看倉(cāng)庫(kù)當(dāng)前的狀態(tài)
$ git status
$ git reflog
$ git diff
$ git log
按行輸出
$ git log --pretty=oneline
回退到上一個(gè)版本
$ git reset --hard HEAD^
回退到上n個(gè)版本
$ git reset --hard HEAD~n
去到指定版本
$ git reset --hard 版本號(hào)
$ git checkout -- 文件名
$ rm 文件名
$ git branch 分支名
$ git checkout 分支名
創(chuàng)建某分支并轉(zhuǎn)到該分支
$ git checkout -b 分支名
$ git branch
$ git merge 分支名
$ git branch -d 分支名
$ git stash
$ git stash list
恢復(fù)后仍保留 stash
$ git stash apply
恢復(fù)后刪除 stash
$ git stash pop
恢復(fù)指定版本的 stash
$ git stash apply stash@{0}
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者