git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "Your local changes ... would be overwritten" bug
@ 2011-09-05 16:25 Hannu Koivisto
  2011-09-05 16:52 ` Matthieu Moy
  2011-09-06  7:34 ` Clemens Buchacher
  0 siblings, 2 replies; 6+ messages in thread
From: Hannu Koivisto @ 2011-09-05 16:25 UTC (permalink / raw)
  To: git

Greetings,

I have a problem where "git checkout origin/another-branch" in master
should remove a set of files but instead I get:

error: Your local changes to the following files would be overwritten by checkout:
        file1
        file2
        ...
Please, commit your changes or stash them before you can switch branches.
Aborting

(where the files listed are those that should be removed)

The problem occurs only if the checkout is not run in the top level
directory of the repository and the files in question have execute
bit set.  Before checkout, git status says

# On branch master
nothing to commit (working directory clean)

The following script can be used to reproduce the problem:

-------------------------------------------
mkdir temp
cd temp
git init
echo foo > testfile
git add testfile
git commit -m "test1"
echo foo > testfile2
chmod +x testfile2
git add testfile2
git commit -m "test2"
mkdir foo
cd foo
git co master~1
--------------------------------------------

The problem disappears if one removes either the "chmod +x
testfile2" line or the "cd foo" line.

I'm running Cygwin git 1.7.5.1 in Windows XP.

-- 
Hannu

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-06  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-05 16:25 "Your local changes ... would be overwritten" bug Hannu Koivisto
2011-09-05 16:52 ` Matthieu Moy
2011-09-05 18:31   ` Vijay Lakshminarayanan
2011-09-05 23:37     ` Andrew Ardill
2011-09-06  7:34 ` Clemens Buchacher
2011-09-06  9:46   ` Hannu Koivisto

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).