本文介绍了在R-studio中使用Git:无法分阶段修改代码文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用git的新手,目前采用以下组合:


  • Git-Gui v.0.20

  • R-studio 0.99.489

  • R 3.22

  • Bitbucket代码库

  • Windows 7



直到最近,这种组合才能正常工作,以便将代码拖放到存储库中。但是现在我无法再推送修改的代码,也不能在R-studio中提交。
在R-studio中,修改后的代码由一个蓝色M标记,旁边有一个复选框。我不能选中这个盒子进行分期,承诺和推动。从字面上看,我点击它时不会检查和反应。



当我创建一个显示为黄色问号的新代码sniplet时?我可以检查并推送它,但修改过的版本不能再被检查。



我已经卸载了git和R-studio并重新安装,但问题仍然存在。我还创建了一个新的存储库,但是在新的存储库中也出现了问题。我有点无知,从哪里开始寻找解决方案,除了这个讨论,网络搜索没有产生许多结果,我不能完全遵循,因为它可能不完全适用于我的问题。无论如何,当我给出

 > sys.which('git')

R返回:

  git 

我会很感激的建议从哪里去。

解决方案

我找到了我的问题的答案。这是RStudio中的一个bug,尽管没有很好的文档。



.R 文件名,不可能通过git推送文件。删除空间可解决问题。



请参阅对Rstudio董事会2015年2月份的官方评论。我正在使用最新版本的Rstudio它还没有在那里修复。


I am new to using git and currently employ the following combination:

  • Git-Gui v.0.20
  • R-studio 0.99.489
  • R 3.22
  • Bitbucket code repository
  • Windows 7

Until recently this combination worked fine for pulling and pushing code to the repository. But now I cannot push modified code anymore nor commit it in R-studio.In R-studio, modified code is marked by a blue M with a checkbox next to it. I cannot check this box for staging, committing and pushing anymore. It literally does not check and react when I click on it.

When I create a new code sniplet which shows as yellow question mark ? I can check and push it, but modified versions cannot be checked anymore.

I have already deinstalled git and R-studio and re-installed but the problem persists. I also created a new repository but the problem occured in the new repository as well. I am a bit clueless where to start looking for a soluation and a web search did not yield many results except this discussion here, which I cannot fully follow because it perhaps does not apply fully to my problem. In any case when I give

> Sys.which('git')

R returns:

git
 ""

I would appreciate advice where to go from here.

解决方案

I found an answer to my question. It is a bug in RStudio, albeit not a very well documented one.

When there is a space in the .R file name, it is not possible to push the file through git. Removing the space solves the problem.

See here for an official comment on the Rstudio board dating February 2015. I am using the most recent version of Rstudio and it is not yet fixed there.

这篇关于在R-studio中使用Git:无法分阶段修改代码文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 11:05