6

I've used Git successfully on this machine in the past but suddenly I can no longer push my commits to the Github repo. The last change to the Git toolchain that I made was to install Git 1.8.5.2, in addition to the Github for Windows client. RStudio could not find Git unless I'd already started the Github client so I decided to simply install a stand-alone Git client and change the RStudio Git path.

Error message (RStudio):

error: cannot spawn rpostback-askpass: No such file or directory

fatal: could not read Username for 'https://github.com': No such file or directory

Troubleshooting:

  1. I can commit all projects.
  2. I can pull new projects.
  3. I cannot push any projects, I receive the same error message every time.
  4. I cannot push with Github or RStudio.
  5. Reinstalling /uninstalling Git / Github does not resolve the issue.

Setup:

This is an R project, with RStudio as my IDE / Git GUI.

I'm using Git 1.8.5.2 for Windows 7.

Let me know if there's any more information that you need.

Update 1:

Git GUI tells me that:

Error: hook execution requires sh (not in PATH).

Let's see if I can fix that...

Alicaceae
  • 93
  • 2
  • 7
  • Do you already have the local repository on your machine before bringing it into Rstudio or do you let RStudio clone it for you by creating a project and specifying the remote repo? – Dason Jan 25 '14 at 03:27
  • This may relate to: http://stackoverflow.com/a/16282505/1000343 – Tyler Rinker Jan 25 '14 at 03:54
  • @Dason: I've been cloning it in from the remote repo. – Alicaceae Jan 25 '14 at 19:49
  • @TylerRinker: That doesn't seem quite right, the question linked is about cloning repos using devtools::install_package(), not pushing like mine. – Alicaceae Jan 25 '14 at 19:51
  • Alice devtools had nothing to do with anything, it's just a way to access the github API. The link was to the answer, not the question. I thought it could be a temporary github problem. Could you post your windows path? – Tyler Rinker Jan 25 '14 at 20:29
  • @Alicaceae I'm not exactly sure your response answered my question unambiguously. Did you use Rstudio to clone the repository or did you use something else? And is it only in rstudio that you're having issues or do you have troubles if you try to push from the command line as well? – Dason Jan 25 '14 at 20:48
  • @Dason: Thanks so much. I've cloned the repo using RStudio. I cannot push from RStudio, command line or Github. – Alicaceae Jan 26 '14 at 00:27
  • @TylerRinker Ah, got it. It doesn't seem to be temporary unfortunately, I can push from other computers just fine. The path to the repo is: "C:\Documents\Research\test" The path to Git is: "C:\Program Files (x86)\Git" – Alicaceae Jan 26 '14 at 00:47
  • Run this in R studio and see what you get: `shell("git --version")` – Tyler Rinker Jan 26 '14 at 02:18

2 Answers2

2

Found something that might help from here: https://github.com/STAT545-UBC/Discussion/issues/93

  • in RStudio, click on the "Tools" menu and select "Shell"
  • Run the following command: git push -u origin master
  • it might ask you for your git username and password. Supply this information, make sure it is correct
  • hopefully the push is successful, then you can close the window
  • Now make some more edits to some file so that you have new content to push
  • click on the "push" button in RStudio and this time the push should work
Scott Newson
  • 2,745
  • 2
  • 24
  • 26
0

Found a different suggested solution here: https://github.com/OHI-Science/ohicore/issues/104

git config --global credential.helper osxkeychain
Scott Newson
  • 2,745
  • 2
  • 24
  • 26