我有一个名为tags的存储库,我将其重命名为tag。
然后,我创建了一个名为 tags 的新存储库(第一个存储库的旧名称)。
现在,当从 R Studio 提交时,两个项目都会尝试提交到同一存储库(标签)。
我启动了我的项目:
shell("git remote add origin https://github.com/moodymudskipper/tag.git", intern = TRUE)
shell("git push -u origin master",intern = TRUE)
和
shell("git remote add origin https://github.com/moodymudskipper/tags.git",intern = TRUE)
shell("git push -u origin master",intern = TRUE)
此后我只通过Rstudio的API和usethis函数进行提交,我对git的了解不多.
软件包链接:
我该如何解决这个问题?
最佳答案
我很犹豫是否要将此作为答案,但是:您可以手动编辑 ./.git/config
文件来更新 [remote ...]
部分更改远程 URL。我已经用一个空的仓库足够自信地完成了这件事......
使用 grep -rli Tags.git .git/* 检查标签是否存在
;如果您得到的只是 .git/config
,那么您就可以编辑并继续。不过,如果您找到其他文件,我不确定它们是否会在您继续 git 远程工作时更新。在这种情况下,查看 https://help.github.com/en/articles/changing-a-remotes-url 可能会有所帮助。以便正式更改 URL。
关于r - 使用 rstudio 和 github,重命名存储库时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56467858/