Blogdown - unable to stage and commit

Hi there, I hope this is the right place to post this question.

I am trying to create a new website using Blogdown in RStudio. However I frequently face a problem of being unable to commit my changes. Specifically, I am unable to stage the changes in the 'Git' window of RStudio.

For example, I will select the check box next to the public/ folder, but nothing will happen. RStudio will then freeze up, as though it is trying to stage the folder, but nothing happens for 10-15 minutes, and then I have to terminate RStudio using Task Manager.

A screen shot is provided below. You will see that I can stage all the files, except for the public/, static/ and theme/ folders

To illustrate the problem, in this example I haven't even made any changes to the downloaded theme. I have run the following code, before trying to commit changes:

  1. library(blogdown)
  2. install_hugo()
  3. new_site(theme = 'kakawait/hugo-tranquilpeak-theme')
  4. serve_site()

To make this more puzzling, I have been able to commit/push other projects to GitHub no problem, and have successfully deployed blogs using Netlify (these were based on the Lithium and Blackburn themes).

I will happily buy a beer, wine, or warm yak milk for anyone who has any ideas on what's going wrong here...

Many thanks for your time, Steve

Edit: It looks like two people had the same question over at Stack Overflow, but there was no answer: r - Blogdown, Git and RStudio: Unable to Stage public/ folder - Stack Overflow

1 Like

Can you try doing this process from the terminal? There is a pane with Terminal window right in RStudio if your version is current enough. Then you can try doing something like git add -a and all of the changes should be staged. I noticed that RStudio sometimes slows down whenever there are a lot of files in git window being staged, so maybe in your case there are too many of them or something.

4 Likes

I can confirm that I encountered the same effect of slowness in git pane when trying to add folder with a lot a files.

A git add public should be quick and solve the issue. Maybe there is a ticket to open into rstudio IDE for this speed things if it is confirmed.

3 Likes

Hi @SteveXD, I recently went through process of setting up Blogdown with GitHub integrating directly with RStudio. I ran into a VERY similar issue, with RStudio essentially crashing and having to terminate after a few minutes. This was relatively reproducible when I went to stage/commit the files.

My suggestion and how I got everything to work was switching away from full integration of Git and RStudio. I switched over to SourceTree at the recommendation of several R Users. Sourcetree is also Jenny Bryan's favorite as mentioned in Happy Git with R.

Sourcetree really improved my Blogdown workflow and I enjoy the UI a lot!

3 Likes

@Mishabalyasin - thank you very much for your suggestion! I tried this using git add -A and the changes were staged instantly.

2 Likes

Thomas, thanks for you suggestion too. I actually independently arrived at this solution too - I downloaded GitHub client for windows, and was able to edit the website in RStudio and then successfully commit/push using the client.

I see in your link that Jenny Bryan explicitly advises against using GitHub client for Windows, so maybe I will use Sourcetree in future. Though I also found that the suggestion from mishabalyasin worked - using git add -A in the RStudio terminal instantly staged the files.

[Sorry, I still need to learnhow to tag people's profile names in RStudio community!]

Glad you got it working! You can tag names with the @ symbol. Eg @SteveXD = @SteveXD.

1 Like

@TMock great, thanks again