天天看點

Git 快捷使用

已經在github上建立了賬号,并建立了repository

[email protected] init 本地電腦建立檔案夾,并建立.git

[email protected] staus 檢視目前檔案夾的檔案,紅色檔案名

[email protected] add -A 把目前檔案夾所有檔案add,再git status,檔案名已變成綠色

[email protected] commit -m "注釋" 把已經add的檔案添加到本地倉庫,并記錄注釋

[email protected] remote add origin [email protected]:使用者名/倉庫名.git

[email protected] push -u origin master 把本地倉庫的檔案push到遠端倉庫

若在github上有倉庫,并已經有檔案,這時候如果要在另一台電腦上push檔案

[email protected] init 本地電腦建立檔案夾,并建立.git

[email protected] remote add origin [email protected]:使用者名/倉庫名.git 關聯遠端倉庫和本地倉庫

[email protected] remote -v 檢視遠端倉庫

[email protected] pull origin master 把遠端倉庫pull到本地

5.拷貝已修改和要增加的檔案到此檔案夾

[email protected] status 檢視這些檔案,檔案名是紅色

[email protected] add -A 把目前檔案夾所有檔案add,再git status,檔案名已變成綠色

[email protected] commit -m "注釋" 把已經add的檔案添加到本地倉庫,并記錄注釋

[email protected] push -u origin master 把本地倉庫的檔案push到遠端倉庫