Reputation: 35
I'm kinda new to the git system, I would like to understand a little thing, maybe it's not even an issue. I got 3 projects, two of those have the origin/master/head signatures in the last commit, one has only master: why?
I read this answer but it's not completly clear to me: How to add missing origin/HEAD in git repo
Thanks a lot
Upvotes: 0
Views: 1721
Reputation: 388
If the repo is only a local repo, you will not have a any origin/** branches in your log. You can check this with the command git remote
, if this returns "origin", it is a remote repo and you will have the origin-branches. Though it might not always be on the last commit. If you make a commit locally, i.e. git commit -m "My commit"
the commit will only exist locally and not in the remote yet. If you do a git push
you will move the origin/HEAD to you last local commit.
In you picture, it doesn't look like you have added any remotes, thus the repo only exists on your local machine. If you e.g. clone an already existing repo, it will exist both locally and in the remote, and you will have the origin/HEAD branch you are referring to.
You can add a remote as well, by git remote add origin <repo url>
. Where origin is a name, you can call your remotes whatever you want.
Upvotes: 1