Git命令

1、拉取仓库的代码

git clone https://github.com/arvidn/libtorrent.git

2、查看分支

本地

git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/RC_1_0
  remotes/origin/RC_1_1
  

远程

git branch -r

3、切换分支

git checkout origin/RC_1_1

4、使用指定 tag(版本)

git checkout libtorrent-1_1_9

5、也可以在clone时 指定tag和branch

git clone -b RC_1_1 https://github.com/arvidn/libtorrent.git 
git clone -b libtorrent-1_1_9 https://github.com/arvidn/libtorrent.git

6、选择指定的commit :切换到 某个提交的版本

	
git checkout ac0ab0c916197f4daf674272a4d0b89cb8b0f7aa

7、拉取最新代码

git pull
git pull [remoteName] [localBranchName]

8、推送代码

git push
git push [remoteName] [localBranchName

9、查看分支状态

git status

10、查看分支提交记录(日志)

git log

11、提交本地test分支作为远程的master分支 //好像只写这一句,远程的github就会自动创建一个test分支

git push origin test:master     

问题1:推送某一分支的某个版本到新分支上

git clone -b lx-back-2022-02-14-15-19 http://gitlab.polixir.site/revive/saas-backend.git

git checkout 98b4c19ab88ec9b09ad5d14e411cb806206f5a47 -b  xxx_new_branch

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值