Rstudio struck out the Git commands and (no branch)

I'm currently trying to get Rstudio to work with git repositories. When I set up a new project and assign a git repository, the branch is set to Master, and the active, pull and push buttons are active. Everything works perfectly. Then at some point the branch switches to (No branch), and the commit, push and push buttons are grayed out (shown below). This happens with every git project that I do. First, gray is executed first.

enter image description here

I can still use the git commands from Shell, but the GUI does not work.

I spent some time browsing the customer support and googling forums. One site I found ( https://www.r-bloggers.com/things-i-forget-pushpull-greyed-out-in-rstudio/ ) indicated that there was a problem in 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 tried to execute git push -u origin master , but that didn't work either.

I use RStudio and github daily, and I would be so happy if the GUI worked correctly again.

I would really appreciate it if someone would help me solve this problem.

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

+5
source share
3 answers

Then, at some point, the branch switches to (No branch), and the fix, pull and gray buttons (shown below).

This is typical of a separate HEAD branch: see " Why did my Git repository become HEAD offline? "

Go back to the command line and check your git status .

You can easily recover from this by checking the branches.
Or by forcing a branch to your current commit

 git branch -f branch-name HEAD git checkout branch-name 

Then go back to RStudio: all options should be available again.


As commented :

Tt turns out to be a key RSA problem.
The wrong key was in Rstudio Config, which explained how Shell would work, but not the Rstudio interface.

+4
source

I had a similar problem with a repo that I already configured locally and pressed and pulled from / to it using the CLI (although I had no problem disconnecting from the branch) and I solved it by doing the following

  • Open console and go to your repo
  • Make commit
  • Do push using the -u flag, for example: git push origin master -u
  • Open Rstudio (or restart it if it was open during the previous step) and you will see that the push and pull icons are no longer grayed out.
+2
source

I just wanted to provide an update if someone had a similar problem in the future. Although the answer provided earlier led to another temporary fix, I ended up having to erase the hard drive; reinstall the operating system; reinstall git, R, RStudio and reconnect to my Github account before it runs sequentially.

My solution may have gone overboard a bit, but since then I have not had any problems.

+1
source

Source: https://habr.com/ru/post/1258019/


All Articles