git 命令

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值