Thanks.
So basically you're saying that the only way for me to run git branch and 
see master is if I'm on the head of it? 
I thought that all branches are conceived of a history of commits, and 
checking out an older commit still means that I'm on the same branch... 
Isn't it so?
If not - then I have another question:
Say I have a commit hash which is shared by two branches (I cherry-picked 
it from one branch to the other).
Now - If I checkout this hash, "where" would I be? If both branches have a 
different set of commits prior to this commit, then which of those past 
commits will I see?

Thanks again!

On Wednesday, October 16, 2013 3:44:48 PM UTC+3, Gergely Polonkai wrote:
>
> master is actually just a pointer to a commit (”hash" in your terms), in 
> your case, to aaa. So if you switch to another commit (git checkout eee), 
> you can no longer be on master (aaa). You can git-reset, if you don't need 
> aaa's changes any more, but bare in mind that it can mess up things if you 
> are using remotes.
>
> Cheers,
> Gergely
> On 16 Oct 2013 14:10, "Roy Vardi" <[email protected] <javascript:>> wrote:
>
>> Hi,
>>
>> git checkout <hash> 
>> results in moving me to a * (no branch)  - If I was on master before the 
>> checkout, after the checkout i'm on no branch...
>> Would like to stay on master...
>>
>> On Wednesday, October 16, 2013 2:18:11 PM UTC+3, Magnus Therning wrote:
>>>
>>> On Wed, Oct 16, 2013 at 12:45 PM, Roy Vardi <[email protected]> wrote: 
>>> > Hi, 
>>> > 
>>> > Simple question: 
>>> > How do I switch to a hash on a branch without creating\moving to a new 
>>> > branch? 
>>> > Say I'm currently at the HEAD of master, and its hash is aaa. 
>>> > I want to stay on master, only switch to a previous hash... (say 
>>> eee...) 
>>> > I know I can use the HEAD~<#> or whatever, but I'd like to find out 
>>> how to 
>>> > do it based only on a hash... 
>>>
>>> I might be misunderstanding you completely, but haven't you tried `git 
>>> checkout <hash>`? 
>>>
>>> /M 
>>>
>>> -- 
>>> Magnus Therning                      OpenPGP: 0xAB4DFBA4 
>>> email: [email protected]   jabber: [email protected] 
>>> twitter: magthe               http://therning.org/magnus 
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Git for human beings" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to