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