mikenguyen13 / bio

0 stars 2 forks source link

post/missing-git-tab-in-rstudio-on-windows-computer/ #1

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Missing Git tab in Rstudio on Windows computer | Mike Nguyen

Due to a new movement in the tech industry, organizations (e.g., companies or universities) will not allow their members to have complete control of their machines (i.e., administrative privileges or running programs as administrators).

https://mikenguyen.netlify.app/post/missing-git-tab-in-rstudio-on-windows-computer/

machsna commented 1 year ago

I happen to work exactly in one of those companies you have described so accurately …

I had to do yet another thing to get the git tab to show up in RStudio. I could access git from the RStudio terminal, but I had the following error:

fatal: detected dubious ownership in repository at 'C:/git/path/to/repo

The problem in my case is that I have to run RStudio with a user that is different from my regular user account. Therefore, all git files need to be in a directory accessible to both users, in my case, C:\git. However, permissions from both users will differ. The git error message already points at the solution, suggesting the following configuration:

git config --global --add safe.directory C:/git/path/to/repo

Even more flexible is the following solution as suggested by Marcodor’s answer to I cannot add the parent directory to *safe.directory* in Git:

git config --global --add safe.directory "*"

Then after restarting R, the git tab would finally show up …

Adding this comment here so others may find it. And thanks again for your article.

mikenguyen13 commented 1 year ago

Thank you for your contribution! I think this is helpful.

marko-ogorevc commented 1 year ago

There is a typo in your instructions.

it should be point to executable: C:\Users\tn9k4\AppData\Local\Programs\Git\mingw64\bin\git.exe,

and add this to "PATH": C:\Users\tn9k4\AppData\Local\Programs\Git\mingw64\bin

Axelb1971 commented 8 months ago

Thanks for you work.

Me helped to type "git status" within the RStudio Terminal. In my case it was a file permission problem of the underlaying file system and ownership. After fixing this, a restart of RStudio enabled the git tab

barbmuhling commented 8 months ago

THANK YOU Mike and Axelb1971, your advice solved my issue (which was driving me nuts).

ksdonaldduck commented 6 months ago

You have successfully helped me, love you gentlemen