Unable to push to remote GIT repository — “[…] does not appear to be a git repository”

懵懂的女人 提交于 2019-12-04 11:44:36
karmakaze

The line git remote add foo myUser@git.mydomain.com:foo.git assumes that the directory foo.git is in the home directory of the myUser user. You're much better off using an absolute path e.g. git remote add foo myUser@git.mydomain.com:/home/gitrepos/foo.git

If you're on a shared server, you can check your home path by executing:

echo $HOME

Which, in my case, yields:

home/u/01234/

If I've stored my repositories in the www/git/ folder in my home-path, the command might look something like this:

git remote add origin myUser@mydomain.com:/home/u/01234/www/git/foo.git
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!