移動後にローカル git リポジトリのパスを修正するにはどうすればよいですか?
previous local location: /C/website
new local location: /C/Projects/website
remote location: git@bitbucket.org:username/website.git
Git リポジトリをあるフォルダー/website
から別のフォルダーに移動し/projects/website
たところ、エラーが発生しました。
user@Thinkpad /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
。ファイルを変更した後にコミットすると、次の応答が返されます。
user@Thinkpad /C/Projects/website (master)
$ git commit -m "added something"
[master e163ad9] added something
0 files changed
create mode 100644 something
user@Thinkpad /C/Projects/website (master)
$ git push
Everything up-to-date