git常用指令

2021-10-01 06:31:00 字數 478 閱讀 4102

2020.06.10更新

後來發現還有更常用的流程是:

git pull 把遠端master分支同步到本地

git checkout -b 分支名 建立新分支

(開始開發----開發完)

git push

(會提示沒有和遠端相應的分支,使用下面指令)

git push --set-upstream origin 分支名

git push

git工具的使用很頻繁,這裡把我常用的指令簡單總結一下:

git init 把乙個目錄初始化

git add 《檔名》 把檔案提交到緩衝區

git commit -a 《提交的描述資訊》

git clone git log 檢視提交日誌

git reflog 檢視所有歷史版本(很強)

git reset --hard 強行切換到某一版本

git push -f 強行push

Git 常用指令

首先需要建立乙個repo,這是cd到資料夾底下,然後init。git init 在檔案系統裡面的檔案如果不新增到git的repo裡面,不會自動被git辨識,需要手動新增,這也是初始化repo是必須要做的事。git add documentation txt git add git sh 刪除檔案,分...

git常用指令

git 常用命令 git init here 建立本地倉庫 repository 將會在資料夾下建立乙個 git 資料夾,git 資料夾裡儲存了所有的版本資訊 標記等內容 git remote add origin git github.com winter1991 helloworld.git 把...

git常用指令

git config global user.name robbin git config global user.email fankai gmail.com git config global color.ui true git config global alias.co checkout g...