[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.
- Git question: when using branches, how does git treat working files when changing branches?, Alan Mackenzie, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?, Steinar Bang, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?, Ricardo Wurmus, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?, Alex Bennée, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?, Alan Mackenzie, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?,
Xue Fuqiao <=
- Re: Git question: when using branches, how does git treat working files when changing branches?, Óscar Fuentes, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?, Alan Mackenzie, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?, Dmitry Gutov, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?, Michael Heerdegen, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?, Michael Heerdegen, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?, Yuri Khan, 2015/10/28
- Re: Git question: when using branches, how does git treat working files when changing branches?, David Kastrup, 2015/10/29
- Re: Git question: when using branches, how does git treat working files when changing branches?, Alan Mackenzie, 2015/10/29
- Re: Git question: when using branches, how does git treat working files when changing branches?, David Kastrup, 2015/10/29
- On the popularity of git [Was: Git question: when using branches, how does git treat working files when changing branches?], Alan Mackenzie, 2015/10/29