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

相关推荐
胖虎12 小时前
Git 一个本地仓库同时推送到两个远程仓库(详细教程)
git·多远程仓库·双远程仓库·git双远程·git备份
春日见13 小时前
如何创建一个PR
运维·开发语言·windows·git·docker·容器
stevenzqzq1 天前
git 常用操作
大数据·git
Curvatureflight1 天前
Git工作流最佳实践:从混乱到优雅
git
wu~9701 天前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github
Vermouth_002 天前
git clone的时候提示access denied
git
qq_437657272 天前
清楚本地的git并重新登录
git
jiang_changsheng2 天前
工作流agent汇总分析 2
java·人工智能·git·python·机器学习·github·语音识别
顶点多余2 天前
版本控制器-git
linux·git
夔曦2 天前
Git工程日常下拉/上传完整流程(自用)
git