Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Head branch unknown

Tags:

git

I have a set of files that needs to be stored in github.

I have a account and created a repository TL1Project and initialized the folder with the set of files with "git init".

Now when I push the project nothing is happening..When I entered "git remote show origin", my head branch is unknown..

How can I fix this issue?

root@ubuntu:/home/pr/Pythonprojects/Info/I2# git remote show origin
* remote origin
  Fetch URL: https://github.com/P1981/TL1Project.git
  Push  URL: https://github.com/P1981/TL1Project.git
  HEAD branch: (unknown)
like image 974
user1050619 Avatar asked Mar 24 '14 15:03

user1050619


People also ask

How do I find my head branch?

You can view your repository's heads in the path . git/refs/heads/ . In this path you will find one file for each branch, and the content in each file will be the commit ID of the tip (most recent commit) of that branch.

What does it mean if head points to the current branch?

The HEAD points out the last commit in the current checkout branch. It is like a pointer to any reference. The HEAD can be understood as the "current branch." When you switch branches with 'checkout,' the HEAD is transferred to the new branch.

How do you meet someone else's branch?

If you want to check out a remote branch someone published, you first have to use git fetch . This command downloads the references from your remote repository to your local machine, including the reference to the remote branch. Now all you need to do is use git checkout <remote branch name> .

What is Origin head branch?

It represents the default branch on a remote and is a local ref representing a local copy of the HEAD in the remote repository. In summary, origin/HEAD represents the default branch on the remote, which is defined automatically when you clone a repository from the internet.


1 Answers

New repo have no branches, github proposes some instructions to get started, here they are

echo "# your-repo-name" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/username/your-repo-name.git
git push -u origin master

This video helps to understand details

like image 92
Wiki Avatar answered Sep 28 '22 10:09

Wiki