Using Git in R-studio: cannot stage modified code files
- 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.
- GitHub Website Publishing of “Knit”-Generated HTML files in RStudio
- Download, Revise, Upload Github Gists with R
- RStudio w/Git Integrated throws index.lock error on commit
- Errors when using RStudio's Git tools
- Pushing to Github from RStudio
- Rstudio Git bash pop-up everytime
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
I would appreciate advice where to go from here.
2 Solutions collect form web for “Using Git in R-studio: cannot stage modified code files”
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.
Try if the issue persists with:
- the latest git for Windows unzipped anywhere you want:
its path added to
its path declare in R-Studio
- R-Studio itself launched from a
CMDsession where %PATH% already references git.