The git tab shows all files in the directory containing R_user, not the files in R_user.

In RStudio, in a project, the git tab shows all files of a directory containing R_user, not the files in R_user.

Instead of seeing files from R_user ="C:/Users/me/OneDrive/Documents/R/work", I see files from "C:/Users/me/OneDrive/Documents/”.

> Sys.getenv("HOME")

[1] "C:/Users/me/OneDrive/Documents"
> getwd()

[1] "C:/Users/me/OneDrive/Documents/R/work"
> Sys.getenv("R_USER")

[1] "C:/Users/me/OneDrive/Documents/R/work"

The RStudio log has:

$HOME

[1] "C:/Users/me/Documents"
$R_USER

[1] "C:/Users/me/Documents"

So, the log and Sys.getenv report different values for R_USER.

If I run git bash from “C:/Users/me/OneDrive/Documents/R/work” I see only files from “C:/Users/me/OneDrive/Documents/R/work”. Shell and terminal show the same correct directory.

The RStudio version is RStudio 2022.07.1+554.

So how do I get the git tab to show the files in "C:/Users/me/OneDrive/Documents/R/work"?

OK, this is what happens if you forget to check "create a git repo". You can recover by going to the directory, running git bash and running git init.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.