Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>why to update these commits into whatever branch they are in?</p> </blockquote> <p>That's just it: you are not on any branch but currently working on a <strong><a href="https://stackoverflow.com/questions/999907/git-push-says-everything-up-to-date-even-though-i-have-local-changes/1000009#1000009">detached head</a></strong>:</p> <blockquote> <p>starting from version 1.5.0, the above command detaches your <code>HEAD</code> from the current branch and directly points at the commit named by the tag.</p> </blockquote> <p>You might see it if you do a <code>gitk --all</code></p> <p>One way to fix it (if you have committed everything)</p> <pre><code>$ git log -1 # note the SHA-1 of latest commit $ git checkout master # reset your branch head to your previously detached commit $ git reset --hard &lt;commit-id&gt; </code></pre> <p>Another way would be to merge your work into the current master HEAD which happens to be at the tag:</p> <pre><code> $ git checkout -m 0.42 </code></pre> <p>but that looses the history of your commits made on a detached HEAD.</p> <hr> <blockquote> <p>I gather this happened when I checked out tag 0.42. Why is that not the same as master? (I had tagged the master in its latest state)</p> </blockquote> <p>No it is not the same than master. As <a href="https://stackoverflow.com/users/119963/jefromi">Jefromi</a> points out in the comments, branch can move (or be renamed, or deleted, or...)<br> <code>master</code> was referring to the same commit than the '0.42' tag, but that won't be always the case.<br> With a checkout of a tag, you do not checkout a branch, hence the 'detached HEAD' state.</p> <hr> <p>Note: as mentioned in <a href="https://stackoverflow.com/questions/964876/head-and-orig-head-in-git/964927#964927">this SO answer</a>, the <code>@{1}</code> notation you see is <code>$(git symbolic-ref HEAD)@{1}</code>, i.e. it is uses reflog for current (here detached) branch, not HEAD reflog. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload