使用改变的git命令序列不显示git remote

时间:2015-11-22 12:06:40

标签: git

我有两个遥控器,'origin'和'hal'来管理。

分支的'origin / mine'和'hal / their'是彼此的“镜像”。

'origin'用于每日访问,而'hal'用于每月发布。

如果我克隆'hal'并拉'origin / mine',我可以在'gitg branch -a'或'gitg'中看到'hal'。

但是,如果我克隆'origin'并拉'hal /他们','hal'就不会显示为下面显示的日志。

me@int_svr:/home/me/work$ cd boot/; git branch -a
* mine
  remotes/m/master -> origin/mine
  remotes/origin/mine

me@int_svr:/home/me/work/boot$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
[remote "origin"]
        url = repoman@int_git:repo/boot
        projectname = boot
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "mine"]
        remote = origin
        merge = refs/heads/mine
[remote "hal"]
        url = ssh://out_src@hal/home/out_src/boot
        fetch = +refs/heads/*:refs/remotes/hal/*

me@int_svr:/home/me/work/boot$ git checkout -b their
me@int_svr:/home/me/work/boot$ git pull hal their
From ssh://hal/home/out_src/boot
 * branch            their -> FETCH_HEAD
Already up-to-date.
me@int_svr:/home/me/work/boot$ git config branch.their.remote hal
me@int_svr:/home/me/work/boot$ git config branch.their.merge refs/heads/their

me@int_svr:/home/me/work/boot$ git branch -a
* mine
  remotes/m/master -> origin/mine
  remotes/origin/mine

me@int_svr:/home/me/work/boot$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
[remote "origin"]
        url = repoman@int_git:repo/boot
        projectname = boot
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "mine"]
        remote = origin
        merge = refs/heads/mine
[remote "hal"]
        url = ssh://out_src@hal/home/out_src/boot
        fetch = +refs/heads/*:refs/remotes/hal/*
[branch "their"]
        remote = hal
        merge = refs/heads/their

1 个答案:

答案 0 :(得分:1)

确定,请尝试:

git fetch hal
git branch -avv