Re: git reset --hard not removing some files

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

 




On Thu, 1 Jun 2006, Martin Waitz wrote:
> 
> I have the following problem:

It's not a problem, it's a feature.

> nbg1l001:~/src/git > git branch
> * master
>   next
>   origin
> nbg1l001:~/src/git > git checkout -b test
> nbg1l001:~/src/git > git status
> # On branch refs/heads/test
> nothing to commit
> zsh: exit 1     git status
> nbg1l001:~/src/git > git reset --hard v1.3.3
> nbg1l001:~/src/git > git status
> # On branch refs/heads/test
> #
> # Untracked files:
> #   (use "git add" to add to commit)
> #
> #       git-quiltimport
> #       git-upload-tar

Those files were _never_ tracked.

What happened is that when you switched to an earlier version, you _also_ 
switched the ".gitignore" file to the earlier version, and that older 
.gitignore file doesn't have those two (newer) binaries listed as being 
ignored.

And "git reset" won't be deleting files it doesn't track (it had _better_ 
not touch them), even more so when it has been told to ignore them, so it 
makes total sense to _not_ delete them when doing that reset.

			Linus
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]