我在将远程存储库添加到本地存储库时遇到问题。我第一次尝试使用to来添加我的本地repo,但当它添加远程repo时,它只显示add the URL。它没有说明有关此URL的任何内容。是否应该包含ssh:// my username等。
因此,我找到了this article,并严格遵循它,直到添加远程存储库。它失败了。有人能帮上忙吗?
Kasper-Srensens-MacBook-Pro:~ Kasper$ git remote add origin ssh://kasperso@kaspersorensen.com:2227/www/mechatronicscluster/wp-content.git fatal: Not a git repository (or any of the parent directories): .git Kasper-Srensens-MacBook-Pro:~ Kasper$
发布于 2011-02-18 09:31:54
您必须在git存储库中才能为此特定存储库添加远程。使用cd更改当前目录。
发布于 2011-02-18 13:12:21
注意:如果您必须在那个git存储库之外执行该命令,那么您可以使用can set the environment variable
(
GIT_DIR=/somewhere/else/.git; export GIT_DIR
git <command>...
)或者只需在命令中使用--git-dir选项
git --git-dir=/somewhere/else/.git <command>...这将适用于不需要在工作树(签出的Git存储库)中的命令。git remote add符合这一标准。
发布于 2014-10-02 15:04:09
例如,使用bitbucket,您可以通过其web服务轻松创建远程分支,然后在塔中获取远程存储库(它将添加新的分支图标)
https://stackoverflow.com/questions/5036774
复制相似问题