由于直接移动了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
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
worktree = /home/xxx/work/git/qemu/dtc
symlinks = false
ignorecase = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git://git.qemu-project.org/dtc.git
然后,然后就可以啦!
xxx@ubuntu:~/work/git/qemu$ git status
# On branch master