emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Git question: when using branches, how does git treat working files


From: Xue Fuqiao
Subject: Re: Git question: when using branches, how does git treat working files when changing branches?
Date: Thu, 29 Oct 2015 06:56:14 +0800

Hi Alan,

On Thu, Oct 29, 2015 at 6:32 AM, Alan Mackenzie <address@hidden> wrote:
> OK, I started with a test repository, with some changes in (which I saved
> in a diff file).  After listing the available branches, and chosing one
> at random, I did
>     $ git checkout /origin/master

It should be `git checkout origin/master' or `git checkout
refs/remotes/origin/master'.

> , and got some message or other about a detached head.  Without doing
> anything else I then switched back with
>     $ git checkout master.
>
> git status now reports that the working directory is "clean".  So one of
> these two operations has discarded my changes.

I don't think something like `/origin/master' should be in your output
of `git branch', unless you used the -r or -a option.  And one usually
shouldn't work in the 'detached HEAD' state, unless he/she would like to
discard the changes later, or want to create a new branch.

Well, this isn't really an answer to your question.  Just some
corrections/suggestions.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]