通过 RStudio 推送 Git 提交

Pushing Git commits through RStudio

我已经开始在 RStudio 中使用 Git 包。它似乎适用于 Master 分支。但是添加另一个分支,您可以通过 GUI 提交任何更改,但 "push" 按钮不起作用。有什么想法可以解决这个问题吗?我可以通过终端而不是 GUI 进行推送。

根据Hadley's explanation

If you try to synchronise this [new] branch to GitHub from inside RStudio, you’ll notice that push and pull are disabled. To enable them, you’ll need to first tell Git that your local branch has a remote equivalent:

git push --set-upstream origin <branch-name> After you’ve done that once, you can use the pull and push buttons as usual.