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)
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.
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.
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> .
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With