git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
vanishxiaoma
V2EX  ›  git

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

  •  
  •   vanishxiaoma · Sep 23, 2019 · 4446 views
    This topic created in 2435 days ago, the information mentioned may be changed or developed.

    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

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

    Supplement 1  ·  Sep 23, 2019
    解决了
    增加 remote 没有使用命令 直接修改的 config 文件
    origin 的 fetch = +refs/heads/*:refs/remotes/origin/*
    和 xxx 的 fetch = +refs/heads/*:refs/remotes/origin/* 一样了
    修改为
    fetch = +refs/heads/*:refs/remotes/xxx/*
    可以了
    5 replies    2019-09-23 18:49:59 +08:00
    0bject
        1
    0bject  
       Sep 23, 2019
    远程分支还在吗
    vanishxiaoma
        2
    vanishxiaoma  
    OP
       Sep 23, 2019
    @0bject 在的直接通过命令
    git pull origin 是可以拉去的
    ayonel
        3
    ayonel  
       Sep 23, 2019
    提示里面不是写的很清楚了么。。git branch --set-upstream-to=<remote>/<branch> xxxx
    vanishxiaoma
        4
    vanishxiaoma  
    OP
       Sep 23, 2019
    @ayonel 执行命令
    git branch --set-upstream-to=origin/xxxx xxxx
    提示
    fatal: Not tracking: ambiguous information for ref refs/remotes/origin/xxxx
    ayonel
        5
    ayonel  
       Sep 23, 2019
    如果不需要本地分支的话,
    1.git brach -d xxxx 将本地分支删除
    2.git checkout remotes/origin/xxxx
    3. git pull
    4. git checkout -b xxxx
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3108 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 13:54 · PVG 21:54 · LAX 06:54 · JFK 09:54
    ♥ Do have faith in what you're doing.