標籤:UNC clone rem lang 重設 git clone 它的 remote tor
# 下載一個項目和它的整個代碼曆史$ git clone [url]
# 添加指定檔案到暫存區$ git add [file1] [file2] ...
# 添加目前的目錄的所有檔案到暫存區$ git add .
# 提交暫存區到倉庫區$ git commit -m [message]
# 提交暫存區的指定檔案到倉庫區$ git commit [file1] [file2] ... -m [message]
# 列出所有本地分支$ git branch
# 列出所有本地分支和遠程分支$ git branch -a
# 建立一個分支,但依然停留在當前分支$ git branch [branch-name]
# 建立一個分支,並切換到該分支$ git checkout -b [branch]
# 切換到指定分支,並更新工作區$ git checkout [branch-name]
# 切換到上一個分支$ git checkout -
# 刪除分支$ git branch -d [branch-name]
# 顯示有變更的檔案$ git status
# 顯示當前分支的版本曆史$ git log
# 顯示暫存區和工作區的代碼差異$ git diff
# 顯示某次提交的中繼資料和內容變化$ git show [commit]
# 從本地master拉取代碼更新當前分支:branch 一般為master
$ git rebase [branch]
#更新遠程倉儲
$ git remote update
# 取回遠程倉庫的變化,並與本地分支合并$ git pull [remote] [branch]
# 上傳本地指定分支到遠程倉庫$ git push [remote] [branch]
# 重設暫存區與工作區,與上一次commit保持一致$ git reset --hard
git常用命令