Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Git in R-studio: cannot stage modified code files

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.

like image 831
tomka Avatar asked Dec 05 '15 12:12

tomka


1 Answers

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.

like image 198
tomka Avatar answered Oct 19 '22 22:10

tomka