【问题标题】:Can't update: no tracked branch error :pathspec 'mybranch' did not match any file(s) known to git无法更新:没有跟踪分支错误:pathspec 'mybranch' 与 git 已知的任何文件都不匹配
【发布时间】:2020-07-02 08:19:34
【问题描述】:

我想将我的 android studio 项目更新到 github
但它说

Can't Update  
                    No tracked branch configured for branch origin or the branch doesn't exist.  
                    To make your branch track a remote branch call,  for example,
                    git branch --set-upstream-to=origin/origin origin (show balloon)  

这个方法我试过了

git checkout mybranch  
git branch --set-upstream-to=origin/mybranch  

但它说

'error :pathspec 'mybranch' did not match any file(s) known to git'  

我现在不知道该怎么做。有没有办法在 Android Studio 中解决这个问题?

【问题讨论】:

    标签: git android-studio github


    【解决方案1】:

    尝试以下方法:

    $ git remote update
    $ git fetch
    

    使用以下命令列出所有分支:

    $ git branch
    

    如果分支存在,您可以使用

    签出到该分支
    $ git checkout mybranch
    

    【讨论】:

    • 在 '$ git checkout --track origin/mybranch' 它出来了'致命:'origin/mybranch' 不是提交,并且不能从中创建分支'mybranch''跨度>
    • 所以你想向现有分支添加新的提交?您是克隆存储库还是这是一个新的存储库?能不能试试上面的步骤。一旦你到达那个分支,我们会更新它。
    • 出了什么问题?
    猜你喜欢
    • 2011-08-24
    • 1970-01-01
    • 2015-02-04
    • 1970-01-01
    • 2022-10-12
    • 1970-01-01
    • 2013-06-01
    • 1970-01-01
    • 2015-08-28
    相关资源
    最近更新 更多