git 库迁移-非clone方式

由于直接移动了git库而导致git不能正常使用,后面认真搜索了git配置文件,终于找到了路径的配置。

xxx@ubuntu:~/work/git/qemu$ git status
# fatal: Could not switch to '/media/sf_vmwork/git/qemu': No such file or directory
qemu/.git/modules/dtc/config: worktree = /media/sf_vmwork/git/qemu/dtc

在“.git”目录里,找到“modules/dtc/config”,编辑这个文件,把这里面的路径修改为你当前的路径就可以了。 

xxx@ubuntu:~/work/git/qemu/.git$ vim modules/dtc/config
1 [core]
2 repositoryformatversion = 0
3 filemode = false
4 bare = false
5 logallrefupdates = true
6 worktree = /home/xxx/work/git/qemu/dtc
7 symlinks = false
8 ignorecase = true
9 [remote "origin"]
10 fetch = +refs/heads/*:refs/remotes/origin/*
11 url = git://git.qemu-project.org/dtc.git

然后,然后就可以啦!

xxx@ubuntu:~/work/git/qemu$ git status
# On branch master

 

posted @ 2016-05-05 20:10  still_waters  阅读(292)  评论(0编辑  收藏  举报