git - 常用指令

  • 1035
  • 0

摘要:git - 常用指令

我這裡要寫的,只有一些常用的指令,大概也只有幾個常用的,不需要知道太多的指令

 

一、Commit  更新變更資訊

git commit -a -v # -v 可以看到檔案哪些內容有被更改, -a 把所有修改的檔案都 commit

or

git commit -a

 

二、push 上傳到Server

git push - u origin master

or

git push

 

三、Pull  重Server 更新下來

git pull

 

四、回到上一版本

git revert HEAD

 

五、不小心下了revert 又想回到原本的檔案時

git reset --hard HEAD^

 

六、顯示狀態

git status

 

沒有特殊需求的話,通常只用的到這幾個,就可以正常版本更新控制了