天天看點

git的使用方法總結

1.建立版本庫

git init

2.檢視狀态

git status

3.檢視日志

git log

4.檢視分支

git branch

5.建立分支

git branch 分支名

6.切換分支

git checkout 分支名

7.送出更改

git commit

8.克隆版本庫

git clone git位址

9.删除分支

git branch -d 分支名

10.添加檔案或檔案夾

git add 檔案名/檔案夾名

11.送出所有修改帶注釋

git commit -m "這裡是修改的注釋" -a

12.送出單個檔案

git commit -m "這裡是注釋" 檔案名

13.撤銷未送出檔案的修改

git checkout head 檔案名

14.合并

git merge

15.重命名分支

git branch -m 分支名

16.顯示标簽

git tag