Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

github website publish cannot publish unborn HEAD

Tags:

git

github

I cannot publish a bootstrap website from my local computer through Github desktop. It states: cannot publish unborn head

What does it mean? What changes should I make?

like image 539
Sofia Kostiunina Avatar asked Jan 30 '18 17:01

Sofia Kostiunina


People also ask

What does cannot publish unborn HEAD mean on github?

This issue occurs because your github repository is empty i.e without a single file.

What does HEAD mean in Git?

When working with Git, only one branch can be checked out at a time - and this is what's called the "HEAD" branch. Often, this is also referred to as the "active" or "current" branch. Git makes note of this current branch in a file located inside the Git repository, in . git/HEAD .

What does publish mean git?

If you want to push to, pull from, or synchronize using a branch you have created, you must publish the branch. You can still commit to an unpublished branch, but until you publish, you will not be able to send your commits to source control for backup.


2 Answers

The reason is that your repository is empty and you should make at least a readme file. It worked in my case.

like image 196
Brij Raj Kishore Avatar answered Oct 14 '22 03:10

Brij Raj Kishore


cannot publish unborn HEAD

This issue occurs because your github repository is empty i.e without a single file.Below is the snapshot.

enter image description here

2 ways to fix this,

  1. While creating repository initialize with default readme file.

enter image description here

  1. Or create a new readme file after repository is created(without readme file).

git init

git add README.md

git commit -m "first commit"

git remote add origin https://github.com/hameedshk/test-stackoverflow.git

git push -u origin master

like image 9
Hameed Syed Avatar answered Oct 14 '22 04:10

Hameed Syed