商汇粹外网资源平台

搜索
查看: 1718|回复: 0

git切换远程分支的问题

[复制链接]

该用户从未签到

3

主题

5

帖子

27

积分

新手上路

Rank: 1

积分
27
发表于 2022-10-18 10:06:49 | 显示全部楼层 |阅读模式
想问下 远程有两个分支test1,test2, 我本地test2分支想更改为后面每次提交都是去test1。先是做了git branch --set-upstream-to=origin/test1 test2.但是每次在test2的本地分支提交代码还是要我使用下面的两种方法,想问下,这个是不是还需要再设置什么之后,每次提交可以直接使用git push到test1上

fatal: The upstream branch of your current branch does not match
the name of your current branch.  To push to the upstream branch
on the remote, use
    git push origin HEAD:test
To push to the branch of the same name on the remote, use
    git push origin HEAD
To choose either option permanently, see push.default in 'git help config'.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表