New project with github repository fails

I have the same problem as the anonymous poster here:

I'm trying to create a new project with version control, but when I create a new project (New Project > New Directory > Empty Project (with "Create a git repository" checked)), the "push" and "pull" options are greyed out (they're greyed out all three places that I know to find them). The new folder has a ".git" hidden folder and a ".gitignore" file, but no new repository is created on my github account. I can still push and pull old projects normally. How do I set up a new project with functional version control through git?

I use the newest version of RStudio on Windows 7.

1 Like

Hi @mzuba!

"Create a git repository" creates a local git repo in your project folder. It doesn't link it to a GitHub remote repository (GitHub is such a popular git service that it's easy to forget that the two things are not the same! :grin:). If you're starting from a local repo, then here's how you connect it to GitHub:

1 Like

Thank you for your help.
It took a while, but I updated my packages and set them up in a nice githup repository.
This has always bugged me before.

Unfortunately, it does not work.

While I can create new repositories, I cannot update any files from within RStudio.

I find it hard to believe that it is possible to create new repositories and upload whole packages but if I attempt to change a single character within a file, the credentials are not sufficient.

I have provided and registered a Github PAT via usethis as recommended in the linked explanation.

However if I make any changes in my project, then stage and commit these, and try to PULL, I get the following error message:

C:/Users/martin.zuba/AppData/Local/Programs/Git/bin/git.exe push origin HEAD:refs/heads/master
fatal: HttpRequestException encountered.
Fehler beim Senden der Anforderung.

Unbehandelte Ausnahme: System.ObjectDisposedException: Auf eine geschlossene Datei kann nicht zugegriffen werden.
bei System.IO.__Error.FileNotOpen()
bei System.IO.FileStream.Flush(Boolean flushToDisk)
bei System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
bei Microsoft.Alm.Git.Trace.Microsoft.Alm.Git.ITrace.Flush()
bei Microsoft.Alm.Cli.Program.Die(String message)
bei Microsoft.Alm.Cli.Program.Die(Exception exception)
bei Microsoft.Alm.Cli.Program.Main(String args)
fatal: HttpRequestException encountered.
Fehler beim Senden der Anforderung.

I am sorry, this is partly German. Basically it says that it can't access closed files. I have not the slightest idea what that means.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.