如何在移动后修复本地git仓库的路径?如何在移动后修复本地git仓库的路径?
previous local location: /C/website
new local location: /C/Projects/website
remote location: [email protected]:username/website.git
我感动从一个文件夹/website
我的git仓库到另一个/projects/website
,现在我得到一个错误:
[email protected] /C/Projects/website (master)
$ git push
fatal: 'C:/website' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
有什么办法来解决这个问题,而不必再克隆项目? 我想:
$ git init
Reinitialized existing Git repository in c:/Projects/website/.git/
这是什么也没做,我再次得到了完全相同的错误,当我试图推动。
编辑:
我跑:git config remote.origin.url C:/Projects/website
。现在,当我改变文件提交后,我得到了如下答复:
[email protected] /C/Projects/website (master)
$ git commit -m "added something"
[master e163ad9] added something
0 files changed
create mode 100644 something
[email protected] /C/Projects/website (master)
$ git push
Everything up-to-date
OK,这是变得非常混乱。什么是您的本地回购,什么是遥控? – fge
Whitecat:你有没有,移动目录和文件,但没有在你的终端仿真器中输入新的目录? (错误消息有点建议这一点)。 @fge:是的,我也很困惑...... – knittl
非常感谢帮忙的人。我的git知识现在已经扩展,我正在向前迈进! – Whitecat