GitHub Error "Failed to get HEAD"

I am new to GitHub and will mainly use it for backups and code demos. Anyway, I try to get my latest program there, and I get an error in the name of this thread when I try to click.

Repro steps:

  • Sit in Starbucks with crappy wifi (could this be due to a problem? Serious question.)
  • Open the latest version of GitHub for the latest Macintosh operating system.
  • File β†’ New Repository
  • Local path -> folder containing the Xcode project
  • Name β†’ indicate name
  • Publish
  • Synchronization
  • Push .... Get error
  • Look into my Xcode project folder and it looks like an empty subfolder with the name of my GitHub project. A?
+5
source share
7 answers

I had these problems, I completed the following steps to solve.

cd /directory git init git add . git commit -m "Name of Repo" 

Then I opened the github desktop application and dragged the folder. Now all my files are available and I can commit. Hope this helps.

+5
source

I got a similar error using GitHub Desktop on OS X. I had an error trying to transfer files for the first time to a newly created repository. The error message was as follows: Failed to get the head (unborn)

The steps I took to create the error were as follows:

  • Created a new repository on GitHub.com
  • Cloned empty repository using GitHub Desktop
  • I created a new project locally on my computer inside the directory in which I cloned the repository in step 2.
  • Using GitHub Desktop, tried to commit files. This is when I got the error.

To fix this, I went to the GitHub desktop and created ReadMe for the repository. Then I synchronized the repository on the GitHub desktop and was able to commit it.

+2
source

This error may appear if you did not initiate a repository. do not forget to check the box "Initialize this repository using README"

+1
source

In my case, all I had to do was run:

 git add -A 

After that, I was able to successfully complete the transaction through the GitHub client.

I used Xcode, and I copied some files to the folder with my project, and they were not automatically added to git (hence the error).

+1
source

Of course not Starbucks Wifi.

This happened to me with the official GitHub client when I tried to make the initial commit, and then tried to use the built-in version control module again in my code editor (Intellij IDEA), and it worked fine.

I will not even question the cause of the problem, but try a different GIT client if you need a quick fix.

0
source

First try locking and try to push. I am also very new to git, I often used SVN, it worked for me after the initial fix.

0
source
 git reset 

And then go back to GitHub Desktop. This works in my case.

0
source

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


All Articles