git 简单操作

0.首先 在github或者码云上创建新分支:develop

1. 克隆远程仓库

  git clone 远程仓库地址 (就是这个)

2. 拉取远程的所有信息(不确定特定分支)

  git pull或者 git fetch

3. 查看所有远程分支

   git branch -a 拉取结果如下,*为所在的分支: * master remotes/origin/develop  remotes/origin/master 

4.切换分支,并在本地创建同样的分支名。

  (例如切换到develop分支) git checkout -b develop origin/develop

再输入命令git branch -a :

切换到本地分支:git checkout develop

5.修改代码(git add .   git commit -m '提交的东西' )之后推送到对应的分支

   git push

6.合并develop分支到master

  git checkout master

  git fetch

  git merge origin/develop

       git push origin master

 以上就是简单的git 操作!

猜你喜欢

转载自www.cnblogs.com/ympjsc/p/12301794.html