Problems with Git Push

Hello all,

I am having trouble pushing my project to git. When I use git push, I receive the error message:

fatal: unable to access directory: Could not resolve host:

So far I have tried:

  • Reconnecting to the VPN.
  • Using as VPN
  • Using as VPN
  • Running git gc --prune=now .
  • Running git remote prune origin . When I run this, I get the same error message as above.
  • Running rm .git/refs/remotes/origin/master and git fetch. When I run rm .git/refs/remotes/origin/master, I get “No such file or directory”. When I run git fetch, I get the same error message as above.

What I haven’t tried is ‘clone, copy, add, commit, and push’ , which Marcel recommended in another forum post, but I don’t really understand what is meant by this.

Thanks in advance for any help, and best wishes for the project. :smiley:


Here are the forum posts I looked at:


This means that you can try cloning the repo into another directory again (using git clone <url>). Then, since you have not pushed, this directory will be deprecated. Therefore, you have to move all files that are changed from you current broken directory to the newly cloned one. Then you can try if git add ., git commit -m <message> and git push work or if you get the same error message again. I recommend to try this, even though the cloning step might already end with the same error message. Please let us know if this worked or if you got another error.

best wishes
Lisa :smiley: )


Thanks for the quick response! I tried cloning the project repo into a different directory, but I get the error fatal: could not create leading directories of './prog2/project5': Permission denied . I played around with the path name a little bit (since I’m not at all sure I’m doing this right), but always ended up with the same error.

To clone, navigate the shell to the folder you want the repository to be in, and then run git clone <URL>. This will likely create a folder that has the name of your username. If this annoys you, you can simply rename the directory later.

I didn’t try doing git clone again yet, but I was able to push my changes from the university.
I’ll try it again later from home. Thanks a lot!