Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rstudio greyed out Git commands and (No branch)

Tags:

git

r

rstudio

I am currently struggling with getting Rstudio to work with my git repositories. When I set up a new project and assign the git repository, the branch is set on Master and the commit, pull, and push buttons are all active. Everything works just fine. Then, at some point the branch is switched to (No Branch) and the commit, pull, and push buttons are greyed out (shown below). This happens to every single git project I make. Works at first then is greyed out.

enter image description here

I am still able to use git commands from Shell, but the GUI interface is not working.

I have spent some time looking through customer support forums and Googling the problem. One site that I found (https://www.r-bloggers.com/things-i-forget-pushpull-greyed-out-in-rstudio/) indicated that there is an issue with the configuration list. However, when I do git config --list, I find that I do have branch.master.remote=origin and branch.master.merge=refs/heads/master at the bottom of the configuration.

I also attempted a git push -u origin master, but that did not work either.

I use RStudio and github daily, and I would be so pleased if the GUI interface was working properly again.

I would be very grateful if someone could help me problem solve this issue.

EDIT: I am using OSX 10.9 Mavericks and Rstudio Version 0.99.903.

like image 427
Xander Avatar asked Oct 11 '16 11:10

Xander


People also ask

How do I create a new branch in RStudio?

RStudio can't create branches directly, so you need to either: create them in GitHub and pull the changes in your repository; create them from the Shell (Tools > Shell) and type git checkout -b new-branch.

What is git branch command?

The git branch command lets you create, list, rename, and delete branches. It doesn't let you switch between branches or put a forked history back together again. For this reason, git branch is tightly integrated with the git checkout and git merge commands.

Where is the git tab in RStudio?

Configure Git in RStudio In RStudio, navigate to Tools >> Global Options, and then click the Git/SVN tab. At the top, there is a place for the filepath of the Git executable. Click Browse and select your Git executable (a .exe file extension).


1 Answers

I had a similar problem with a repo I had already configured locally and pushed and pulled from/to it using CLI (although I didn't have the problem of being detached from a branch) and I solved it by doing the following:

  1. Open your console and navigate to your repo
  2. Make some commit
  3. Make a push using -u (i.e. --set-upstream) flag, eg: git push origin master -u
  4. Open Rstudio (or restart it if it was open while performing the previous step) and you'll see the push and pull icons are no longer greyed out.
like image 102
ccamara Avatar answered Sep 20 '22 02:09

ccamara