<div dir="ltr">git checkout -b eliot_path_leading_to_this_point<div><br></div><div>From there, well, add, commit</div><div><br></div><div>Then checkout the dev or master branch and just rebase or merge the eliot_path_leading_to_this_point one in it.</div><div><br></div><div>Phil</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 12, 2016 at 7:22 PM, Ben Coman <span dir="ltr">&lt;<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On Wed, Oct 12, 2016 at 8:20 AM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; I&#39;m stuck.  Don&#39;t know how I detached from the master.<br>
<br>
Maybe a good opportunity to peek under the hood to understand how it<br>
may have happened.   I&#39;m freshly enlightened from reading around the<br>
subject past couple of hours and I picked a few of the best<br>
articles...<br>
<br>
A programming analogy providing an interesting alternative to most articles...<br>
  <a href="http://gitolite.com/detached-head.html" rel="noreferrer" target="_blank">http://gitolite.com/detached-<wbr>head.html</a><br>
<br>
coupled with a visual presentation...<br>
  <a href="http://marklodato.github.io/visual-git-guide/index-en.html#detached" rel="noreferrer" target="_blank">http://marklodato.github.io/<wbr>visual-git-guide/index-en.<wbr>html#detached</a><br>
<br>
and bringing it together (with a comparison to Mercurial)...<br>
  <a href="http://ideasintosoftware.com/git-detached-head-state-for-dummies/" rel="noreferrer" target="_blank">http://ideasintosoftware.com/<wbr>git-detached-head-state-for-<wbr>dummies/</a><br>
<br>
<br>
&gt; I&#39;m seeing this:<br>
&gt;<br>
&gt; You are in &#39;detached HEAD&#39; state. You can look around, make experimental<br>
&gt; changes and commit them, and you can discard any commits you make in this<br>
&gt; state without impacting any branches by performing another checkout.<br>
&gt;<br>
&gt; If you want to create a new branch to retain commits you create, you may<br>
&gt; do so (now or later) by using -b with the checkout command again. Example:<br>
&gt;<br>
&gt;   git checkout -b &lt;new-branch-name&gt;<br>
&gt;<br>
&gt; HEAD is now at ed4a499... CogVM source as per VMMaker.oscog-eem.1958<br>
&gt;<br>
&gt; I want to make this the new master, and then add a commit.  I&#39;m stuck.  Git mavens, help please.<br>
<br>
At  <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/network" rel="noreferrer" target="_blank">https://github.com/<wbr>OpenSmalltalk/opensmalltalk-<wbr>vm/network</a><br>
I see that ed4a499 at this moment is a couple of commits back from the<br>
tip of the Cog branch around the 12 Oct<br>
but no merges after that, so without more background info I&#39;ll assume<br>
for discussion a hypothetical scenario where you wanted to throw away<br>
some local commits and in svn you would use &#39;checkout&#39; (??) so you<br>
used something like &#39;git checkout HEAD~1&#39; instead of  &#39;git reset<br>
HEAD~1&#39; to move to branch to a previous commit??   The difference is<br>
demostrated here... (use left/right arrow keys to navigate)<br>
  <a href="http://gitolite.com/gcs.html#(45)" rel="noreferrer" target="_blank">http://gitolite.com/gcs.html#(<wbr>45)</a><br>
<br>
John&#39;s example seems a common way to deal with a detached HEAD. Since<br>
the commit was given to you actually could probably do...<br>
  $ git checkout Cog<br>
  $ git merge ed4a499<br>
except that wouldn&#39;t help the hypothetical scenario above if the Cog<br>
branch had moved forward with commits you wanted to kill.  If these<br>
were only local changes, then &#39;reset&#39; is probably what you need, but<br>
if the commits had already been made public, &#39;revert&#39; may be more<br>
appropriate.<br>
  <a href="https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting/file-level-operations" rel="noreferrer" target="_blank">https://www.atlassian.com/git/<wbr>tutorials/resetting-checking-<wbr>out-and-reverting/file-level-<wbr>operations</a><br>
<br>
cheers -ben<br>
<br>
</blockquote></div><br></div>