2017-06-01 80 views
1

我使用浏览分支下拉菜单在github上创建了一个新的分支...在新的分支名称中键入,以便创建基于PR的新分支我在看。使用不同于本地的名称将上游分支设置为远程

我后来去当地,做了git checkout -b myBranch

如何同步我的分支远程?我没有将我的本地分支命名为与远程同名的分支。

git push -u origin my_branch - 我认为这是如果你已经同步的事情,并且本地和远程分支名称是完全一样的。

那么我的情况呢?

我试过,但得到了一个错误

▶GIT中分支--set-上游到原点= /特征/ WA-3 WA-3 错误:所请求的上游分支“起源/特征/ WA- 3' 不存在

更多信息以帮助

远程分支的名字是feature/WA-3,而我的地方被命名为W3

▶混帐远程节目出身

* remote origin 
    Fetch URL: https://github.com/xxxx.git 
    Push URL: https://github.com/xxxx.git 
    HEAD branch: develop 
    Remote branches: 
    develop       tracked 
    feature/WA-3     new (next fetch will store in remotes/origin) 
    master       tracked 
    refs/remotes/origin/w9-homepage stale (use 'git remote prune' to remove) 
    w1-log-in    tracked 
    wa-9     tracked 
    Local branches configured for 'git pull': 
    develop   merges with remote develop 
    w1-log-in merges with remote w1-user-can-log-in 
    w9-homepage  merges with remote wa-9-homepage 
    Local refs configured for 'git push': 
    develop   pushes to develop   (up to date) 
    w1-log-in pushes to w1-log-in (up to date) 

enter image description here

+0

'新(下次提取将在遥控器/原产地存储)'听起来不可思议。你尝试过取? – choroba

回答

1

使用冒号表示:

git push -u origin my_branch:myBranch 
+0

▶git branch -u feature/WA-3:WA-3 错误:请求的上游分支'feature/WA-3:WA-3'不存在 – PositiveGuy

+0

是我在github中给出的错误名称?为什么找不到它? – PositiveGuy

+0

我从字面上命名远程分支为'feature/WA-3' – PositiveGuy

相关问题