git 远程多分支,本地如何切换分支

1、git clone url

先clone 项目,git branch -a 查看所有分支,发现有多个远程分支

2、假如想在 remote 分支工作,但是本地还没有 remote 分支,可以先输入命令:

git checkout ,不要按回车键,按 Tab 键提示

3、执行命令:git checkout remote ,看结果

Checking out files: 100% (1234/1234), Done

Switched to a new branch 'remote'

Branch 'remote' set up to track remote branch 'remote' from ''origin

就是本地 remote 分支对应远程 remote 分支。

再用 git branch -a 看一下

4、当前本地分支就是 remote ,可以修改提交了。

相关推荐
黑牛先生2 小时前
【Git】解决远程仓库备注错误问题
git
rockmelodies3 小时前
Git冲突解决实用指南
git·git冲突
bj_zhb3 小时前
Git 回退到某个 commit
git·github
凯子坚持 c3 小时前
Git分支实战指南:如何优雅地管理版本、修复Bug并解决合并冲突
git·bug
openinstall全渠道统计3 小时前
开发者指南:广告投放系统搭建与前后端数据打通全流程
windows·git·oracle·eclipse·sqlite·github
yunianshu4 小时前
在 DevEco Studio 中查看 Git 本地更改 (Local Changes) 指南
git
脾气有点小暴4 小时前
git commit 的提交如何撤销
git
winner88814 小时前
Git撤销修改:git restore . 与 git reset --hard 万字详解
git·git reset·git restore .
我的offer在哪里4 小时前
SourceTree 全方位使用教程
git
Irene199115 小时前
查看是否已安装 Git 的方法
git