git的指令

1、git clone 路径 文件夹名字 ;克隆文件

2、ssh-keygen -t rsa -C 邮箱地址  (添加公匙:一直回车就行)

  找到公匙复制,到github中设置

  打开GitHub中用户下的setting,找到ssh,填写title,下面的框中填写复制的公匙

3、git config --global user.name 用户名

4、git config --global user.email 邮箱

5、git status  查看状态

6、git add . 放进仓库中

7、git config --global alias.st status  改status为st (其他指令也可以改)

8、git commit -m '描述' 提交到暂存区

9、git push 提交到GitHub上

10、git rm + 文件名  删除文件

11、git branch + 分支名字  创建分支

12、git checkout + 分支名字  进入分支

13、git branch 查看分支

14、git push --set-upstream origin + 分支名字  提交分支到GitHub

15、git branch -a 查看所有分支

16、git merge + 分支名字  向你所在的分支,合并分支

17、git fetch --all 找到所有线上分支;

原文地址:https://www.cnblogs.com/naxiaoming/p/8111466.html