'Git tab missing in RStudio after git installed on Windows

Installed R, R Studio, Git but when I opened R Studio, there was no Git tab,

like the screenshot below:
enter image description here
Windows 8.1, x64
R version: 3.5.1
R Studio version: 1.1.463
Git: 2.19.2

When I opened Tools/Global Options/GitSVN:
Git executable: C:/Program Files/Git/bin/git.exe
SVN executable: C:/Program Files/Git/bin/sh.exe
* I cannot find any file called "svn.exe" in the git folder.

I tried to solve the issue by following methods, but none of them work:
1. After I ran Sys.which("git")in the R Studio, the output was:
"C:\\PROGRA~1\\Git\\cmd\\git.exe", so I tried to change the git executable to cmd/git instead of bin/git, not work.
2. Re-install everything, no success.
3. Tried older Git version 2.14 but still no success.

Anyone can help me with this? Thank you!



Solution 1:[1]

In order to see the Git tab in the upper right pane in RStudio, one must create an RStudio project, as follows.

Starting from the RStudio main panel, there is no git tab prior to loading a project

enter image description here

Select File > New Project from the main menu bar to create a project

enter image description here

Select New Directory on the dialog box that appears.

enter image description here

Next, fill out the new project information, check the create git repository box, and press the Create Project button.

enter image description here

Once the project has been created, the Git tab is now visible in the upper right quadrant of RStudio.

enter image description here

See also Version Control with Git and SVN on the RStudio support website.

Solution 2:[2]

An additional answer, as I got the following problem:

After correctly installing RStudio and cloning a Git R project, I had indeed the Git tab. However, after a while, the Git tab didn't show when opening the project. The project was still a Git project, as could be checked from a Git bash terminal.

Solution: the path to git.exe was mysteriously lost in RStudio options. Put it back, restart RStudio, and everything is all right.

I might be useful to know where this option is stored: on Windows, it's in a JSON dictionary, namely %USERPROFILE%\AppData\Roaming\RStudio\rstudio-prefs.json, under the key git_exe_path.

Solution 3:[3]

Also had this problem (Git tab disappearing in a project that was already cloned and had been working perfectly well before, and I was still able to push/pull from the Git GUI)

What solved the issue for me was View->Panes->Zoom Git, which made it appear again

Then you just need to adjust the pane layout to what you had before

Solution 4:[4]

  1. Go to a desired Git Project > Fork
  2. On R Studieos > Create New project > Version Control > Git > Give details
  3. New git project created. Icon will be seen.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Jean-Claude Arbaut
Solution 3 Guilherme
Solution 4 tkrloltkr