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 18:00:52 +0200
Martin Waitz <tali@xxxxxxxxxxxxxx> wrote:

Removed your prompt just to make it a bit more readable:

> $ git branch
> * master
>   next
>   origin
>
> $ git checkout -b test
>
> $ git status
> # On branch refs/heads/test
> nothing to commit

The generated files "git-quiltimport" and "git-upload-tar" exist at
this point.  They are both untracked files and aren't listed because
they have entries in the .gitignore file.

> $ git reset --hard v1.3.3
>
> $ git status
> # On branch refs/heads/test
> #
> # Untracked files:
> #   (use "git add" to add to commit)
> #
> #       git-quiltimport
> #       git-upload-tar
> nothing to commit

Resetting to version 1.3.3 gets you an old version of the .gitignore
file which doesn't ignore these two untracked files.  Reset --hard
doesn't remove them because it only deals with tracked files.  Thus,
they show up in your status report.

> $ git reset --hard master
> $ git status
> # On branch refs/heads/test
> nothing to commit

Returning to the current version gets you an updated .gitignore and the
two files are no longer listed even though they still exist.

> $ git --version
> git version 1.3.3.g0825d

This is the expected behavior regardless of version.

Sean
-
: 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]