r - 使用 rstudio 和 github,重命名存储库时出现问题

标签 r git github rstudio

我有一个名为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/

相关文章:

git merge 上游/master "already up-to-date"

github - github 操作中的权限被拒绝错误

r - SuperImpose 直方图适合一张图 ggplot

git - 通过 Git 部署网站

html - CSS 背景图片将在本地显示,但不会在 gh-pages 上显示,收到 404 错误

git - 如何将 --color-words 与 git add --patch 一起使用?

git - "Could not read from remote repo"...但我是所有者?

r - 通过比较字符串来测试 R 中的警告(最好的主意?)

r - 如何在R中反转字符串

r - 在 R 中绘制两个条形图