从usb键上的裸仓库中获取远程分支

时间:2014-12-17 09:14:45

标签: git git-branch

我在usb键上启动了一个裸仓库(驱动器d :)并推了一些分支:developfeature-xxx-ui等等。但是,不知怎的,我还设法推了一个{{ 1}}分支到密钥。 (参见下面的 USB Key

如何从密钥中获取提交remotes/origin/feature-YYY分支a20d561。它似乎不被列为分支:

这是我的本地回购

remotes/origin/feature-YYY

这是我的 USB密钥

c:\projects\my-super-app>git branch -av
  develop                       00eb70d [behind 5] Now loading config
* feature-xxx-ui                e2a7e75 Can now run commands
  master                        4d7a284 Merge branch 'release-0.7'
  remotes/origin/HEAD           -> origin/master
  remotes/origin/develop        e2a7e75 Can now run commands
  remotes/origin/feature-xxx-ui e2a7e75 Can now run commands
  remotes/origin/master         4d7a284 Merge branch 'release-0.7'

c:\projects\my-super-app>git remote show origin
* remote origin
  Fetch URL: d:\git\my-super-app.git
  Push  URL: d:\git\my-super-app.git
  HEAD branch: master
  Remote branches:
    develop        tracked
    feature-xxx-ui tracked
    master         tracked
  Local branches configured for 'git pull':
    develop        merges with remote develop
    feature-xxx-ui merges with remote feature-xxx-ui
    master         merges with remote master
  Local refs configured for 'git push':
    develop        pushes to develop        (local out of date)
    feature-xxx-ui pushes to feature-xxx-ui (up to date)
    master         pushes to master         (up to date)

1 个答案:

答案 0 :(得分:0)

你可以尝试在usb裸仓库上创建一个分支,看看你是否可以从你当地的非裸仓库中获取它:

d:
cd d:\git\my-super-app.git
git branch wip a20d561 

c:
cd c:\projects\my-super-app
git fetch
# check if remotes/origin/wip exists
git checkout -b wip origin/wip