1、克隆下载项目   

git clone https......

2、更新代码    

git pull 

3、提交    

git commit -a -m '本次更新内容' 

4、上传  

git push 

5、建分支  

git branch test

建一个名字为test的分支

6、切换分支    

git checkout test

在test分支下工作

7、合并    

      git checkout master  

      git merge test

 移到master,然后进行合并分支操作

      git checkout master  

      git cherry-pick  6f64daf

 移到master,然后进行合并某一提交

8、删除分支  

git branch -d test

git branch -D test (强制删除)

删除test分支

9、新建远程分支

git push origin test

新建远程分支test

10、删除远程分支

git push origin --delete test

删除远程分支test

11、打tag

git tag 1.0

12、上传tag

git push origin --tags

13、删除tag

git tag -d 1.0   (删除tag)

git push origin : 1.0    (同步到远程仓库)

14、第一次关联项目

1)cd 到本地项目地址

2)git init 

3)  git add . 

4)  git commit -m "创建"

5)git remote add origin https://~~~git 地址         添加远程版本库

6)git push -u origin master        将本地的master分支推送到origin主机

15、解除与远程库的关联

find . -name ".git" | xargs rm -Rf

 

16、重命名分支

1) git branch -m oldName  newName
2) git push origin newName
3) git push --delete origin oldName

 

 

资源:https://git-scm.com/book/zh/v2

 

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐