Git获取新分支失败

时间:2016-11-22 19:57:54

标签: git github

新的分支AAA是基于master创建的,现在我想拉/取到我的本地机器,失败了。怎么做?

请注意,目录不同。我想将AAA拉入app文件夹。什么是拉新分支的正确步骤?

--in app/myproject
    $ git remote show origin
    Password for 'https://xxx@ibgit.com:8443':
    * remote origin
      Fetch URL: https://xxx@ibgit.com:8443/scm/s.git
      Push  URL: https://xxx@ibgit.com:8443/scm/s.git
      HEAD branch: master
      Remote branches:
        M-10125                                 tracked
        feature/AAA                      new (next fetch will store in remotes/origin)
        master                                     tracked
        release-0.0.0.0                            tracked

      Local branch configured for 'git pull':
        master merges with remote master
      Local ref configured for 'git push':
        master pushes to master (local out of date)

    -- in app directory
    $ git fetch  feature/AAA
    fatal: Not a git repository (or any of the parent directories): .git

    $ git fetch AAA
    fatal: Not a git repository (or any of the parent directories): .git

    $ git fetch origin/AAA
    fatal: Not a git repository (or any of the parent directories): .git

由于

2 个答案:

答案 0 :(得分:0)

似乎找不到您的.git文件夹。 如果该文件夹存在,也许检查该文件夹的权限,如果该文件夹不存在,请执行git init

答案 1 :(得分:0)

您的Git存储库似乎位于app/project内。

请尝试找到.git目录的位置。 .git目录通常位于项目的根目录中。

您需要在app/project中运行Git命令,或者您可以通过移除app/project/.git并在git init中运行app来创建新的回购。