git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: "René Doß" <doss@gmx.de>
Cc: <git@vger.kernel.org>
Subject: Re: checkout on an empty directory fails
Date: Thu, 5 Jan 2012 12:13:32 +0100	[thread overview]
Message-ID: <87d3ayz9k3.fsf@thomas.inf.ethz.ch> (raw)
In-Reply-To: <4F0576D9.4030207@gmx.de> ("René Doß"'s message of "Thu, 05 Jan 2012 11:09:29 +0100")

René Doß <doss@gmx.de> writes:

> I have a clean derectory ang the git database. Now I want check out
> the master.

Ok, but why?  What problem were you really trying to solve?

> red@linux-nrd1:~/iso/a> git checkout master
> D       SP601_RevC_annotated_master_ucf_8-28-09.ucf
> D       rtl/ether_speed.vhd
> D       rtl/ether_top.vhd
> D       rtl/ether_tx.vhd
> D       rtl/takt.vhd
> D       sim/makefile
> D       sim/tb_ether_top.vhd
> Already on 'master'

git-checkout considers this an uncommitted change compared to the
current branch (HEAD).  It actually ensures that you do not lose such
changes.

To get your files back, you can use the file-argument form of checkout

  git checkout -- .

or the "really give me back the HEAD state, period" form of git-reset

  git reset --hard

Both of those *will* destroy uncommitted changes with no recourse or
backup, so be careful.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

      parent reply	other threads:[~2012-01-05 11:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05 10:09 checkout on an empty directory fails René Doß
2012-01-05 11:06 ` Nguyen Thai Ngoc Duy
2012-01-05 12:38   ` René Doß
2012-01-05 13:59     ` Holger Hellmuth
2012-01-05 19:33       ` Dirk Süsserott
2012-01-05 11:07 ` Ramkumar Ramachandra
2012-01-05 11:13 ` Thomas Rast [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d3ayz9k3.fsf@thomas.inf.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=doss@gmx.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).