V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
vanishxiaoma
V2EX  ›  git

git pull 时 出现 There is no tracking information for the current branch

  •  
  •   vanishxiaoma · 2019-09-23 18:29:32 +08:00 · 3546 次点击
    这是一个创建于 1648 天前的主题,其中的信息可能已经有所发展或是发生改变。

    There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details.

    git pull <remote> <branch>
    

    If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=<remote>/<branch> xxxx
    

    执行命令 git branch --set-upstream-to=origin/xxxx xxxx

    fatal: Not tracking: ambiguous information for ref refs/remotes/origin/xxxx

    没有成功 有遇到过这种问题的吗

    第 1 条附言  ·  2019-09-23 19:04:38 +08:00
    解决了
    增加 remote 没有使用命令 直接修改的 config 文件
    origin 的 fetch = +refs/heads/*:refs/remotes/origin/*
    和 xxx 的 fetch = +refs/heads/*:refs/remotes/origin/* 一样了
    修改为
    fetch = +refs/heads/*:refs/remotes/xxx/*
    可以了
    5 条回复    2019-09-23 18:49:59 +08:00
    0bject
        1
    0bject  
       2019-09-23 18:40:08 +08:00
    远程分支还在吗
    vanishxiaoma
        2
    vanishxiaoma  
    OP
       2019-09-23 18:40:52 +08:00
    @0bject 在的直接通过命令
    git pull origin 是可以拉去的
    ayonel
        3
    ayonel  
       2019-09-23 18:45:12 +08:00
    提示里面不是写的很清楚了么。。git branch --set-upstream-to=<remote>/<branch> xxxx
    vanishxiaoma
        4
    vanishxiaoma  
    OP
       2019-09-23 18:46:24 +08:00
    @ayonel 执行命令
    git branch --set-upstream-to=origin/xxxx xxxx
    提示
    fatal: Not tracking: ambiguous information for ref refs/remotes/origin/xxxx
    ayonel
        5
    ayonel  
       2019-09-23 18:49:59 +08:00
    如果不需要本地分支的话,
    1.git brach -d xxxx 将本地分支删除
    2.git checkout remotes/origin/xxxx
    3. git pull
    4. git checkout -b xxxx
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   940 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:52 · PVG 04:52 · LAX 13:52 · JFK 16:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.