小编m1s*_*hka的帖子

Git push:为分支设置目标

我想用我的当前分支(hp1)

git push
Run Code Online (Sandbox Code Playgroud)

并不是

git push origin hp1:team/hp1
Run Code Online (Sandbox Code Playgroud)

远程分支已经存在.

我当地的分店:

develop
master
* hp1
Run Code Online (Sandbox Code Playgroud)

git远程显示来源告诉我:

Remote branches:
  develop  tracked
  master   tracked
  team/h2  tracked
  team/hp1 tracked
  team/n1  tracked
Local branches configured for 'git pull':
  develop  merges with remote develop
  master   merges with remote master
  hp1 merges with remote team/hp1
Local refs configured for 'git push':
  master   pushes to master   (up to date)
Run Code Online (Sandbox Code Playgroud)

我已经试过了

git branch --set-upstream hp1 origin/team/hp1
Run Code Online (Sandbox Code Playgroud)

git branch --set-upstream hp1 refs/remotes/origin/team/hp1
Run Code Online (Sandbox Code Playgroud)

但两者都不起作用.

我的同事有一个叫做远程分支的本地分支(team/hp1),上面的代码适合他.他最后得到了一个额外的

Local refs configured for 'git …
Run Code Online (Sandbox Code Playgroud)

git

29
推荐指数
1
解决办法
3万
查看次数

标签 统计

git ×1