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 ,可以修改提交了。

相关推荐
fpcc1 小时前
工具使用—git diff命令分析说明
git·工具
console.log('npc')2 小时前
Git 删除指定提交记录操作指南
git
随风丶飘2 小时前
[特殊字符] 告别“update“和“fix bug“——Smart Git Commit LLM 让 AI 帮你写专业的 Git 提交信息
人工智能·git·bug
yanlaifan2 小时前
git clone时候指定换行符
git
小小安于乱6 小时前
解决IDEA的git插件pull代码冲突但右下角不提示消息问题
java·git·intellij-idea
ITKEY_9 小时前
git 命令行操作回退到指定版本
git
New_Horizons66611 小时前
Git 操作(使用git-commit-template)
git
慕容引刀14 小时前
或许你真的需要这个Git神器:让团队提交文案终于对齐了
人工智能·git·vscode·自然语言处理·github
jjh+++(求关注版)14 小时前
git-命令速查清单
git
yanlaifan1 天前
git版本管理工具中的回车换行转换逻辑
git