【问题标题】:Adding a Git remote... am I doing it right?添加一个 Git 遥控器……我做得对吗?
【发布时间】:2012-10-09 14:51:17
【问题描述】:

当我将一个主题分支合并到 master 时,我收到了这条消息。我在 bitbucket 也有一个名为 origin 的遥控器,heroku 名为 dev(最初是 origin,但已重命名)。

我是否也应该说一下 origin/bitbucket 后面有多少次提交?这是因为未克隆 bitbucket(现在的来源)吗?我怀疑这与跟踪分支有关,但我不完全确定这意味着什么。

 mistakes|tags-2col ⇒ co master
 Switched to branch 'master'
 mistakes|master ⇒ gmerge tags-2col 
 Merge made by the 'recursive' strategy.
  app.rb                 |    2 ++
  views/new/all_tags.erb |   57 +++++++++++++++++++++++++++++++++---------------
  2 files changed, 41 insertions(+), 18 deletions(-)
 mistakes|master ⇒ gs
 # On branch master
 # Your branch is ahead of 'dev/master' by 2 commits.
 #
 nothing to commit (working directory clean)


 mistakes|master ⇒ git remote
 dev
 origin

【问题讨论】:

    标签: git


    【解决方案1】:

    upstream 分支相比,您应该只会看到一条关于master 的消息。

    如果master 正在跟踪“dev/master”,那么您就知道它与远程分支相比的情况。
    见“Git: which is the default configured remote for branch?”。

    可以设置一个带有多个 url的遥控器,但它似乎不安全:
    见“Git status in regards to multiple remote repositories”。

    【讨论】:

    • 谢谢!!非常感谢,我刚刚将跟踪切换到 Origin.. 我想我现在已经解决了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-10-28
    • 2012-06-17
    • 2014-05-24
    • 2014-12-09
    • 1970-01-01
    • 1970-01-01
    • 2014-08-11
    相关资源
    最近更新 更多