0

I also read a lot on this and don't grasp it. I can delete and Keep local, in Windows Explorer or in Tortoisegit. Elsewhere here, it was recommended to push and then pull to/from remote to make the delete stick.

I don't want the delete in remote/origin (yet), I want it only in my local repository.

How to do that? After my next commit to the local repository (although the files are marked red in commit Dialog and are checked), the Windows overlay in Explorer does Show them as part of the repo again.

There should be a way to get them out of the next commit, but Keep them in the old commits, but I don't see what to do.

Looking at the command line descriptions, it seems I would Need to stage by rm and then in commit add some extra Options. Doesn't Tortoise do this?

thanks for any help,

Klaus

opto
  • 57
  • 6
  • more info: after deleting and a commit, Tortoisegit throws an error saying: nothing added to commit but an untraccked file. In the commit file list, the deleted files was shown as to be deleted and checked. The message (doing nothing) would be ok if the file would Keep being deleted,although I would have hoped I could add a commit message to the delete. But going back to Windows Explorer, the file is shown as undeleted and part of the tracked repo. – opto Nov 23 '13 at 13:48

3 Answers3

1

this seems to be a bug in 64 bit TortoiseGit, see https://tortoisegit.org/issue/1675 where is is described for deleting Folders Keep local.

The original idea of how it should work seems to be what I wrote in my comment: the file is kept localy in the Directory as untracked, but should be removed from the local index. The bug seems to be fixed (see This issue was closed by revision 3a6e98b0c2e0 in the abovementioned link). Haven't tried yet.

If I don't come back here, upgrading has solved the Problem. Maybe this helps others having a similiar Problem.

thanks for all answers.

Klaus

MrTux
  • 32,350
  • 30
  • 109
  • 146
opto
  • 57
  • 6
0

I don't want the delete in remote/origin (yet), I want it only in my local repository.

That is what a "Delete (keep local)" does: it is a git rm --cached: your file is removed from the index, but not from the working directory.
You next commit will record that deletion, but the file will stii be there on your disk.

That won't affect the remote 'origin', not until you push that commit.

You can also, once the delete is done, add that file to your .gitignore in order to not add it again.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • may be that is what is meant? I understood: delete from index, but Keep file locally as untracked. Maybe it means: delete from remote index, but Keep file in local index? Feels a bit silly, because I am committing to local index, but could be. – opto Nov 24 '13 at 12:16
  • here goes on: if I delete, the file is gone from the Directory and the index after committing. If I delete Keep local, the tortoisegit overlay in Windows Explorer marks the file with a red cross, but after the next commit (locally), the file is still there (expected) and the overlay Shows it is tracked (unexpected), also repo browser Shows it is tracked. at least repo browser should Show it as untracked. It all boils down to whether - in delete Keep locally - the index (local) is meant, or the file System. but thanks for your answer, Klaus – opto Nov 24 '13 at 12:22
  • @user2579846 "the file is still there (expected) and the overlay Shows it is tracked (unexpected)": the latter is expected when rm --cached. "repo browser Shows it is tracked.": it should not show it at all once you `git push`. Until you push that deletion to said repo, as far as the remote repo is concerned, that file is still tracked. That is consistent with the "distributed" nature of Git. – VonC Nov 24 '13 at 12:31
0

Above answer is correct. But in windows you can delete open files.

So if your git workspace root is C:/something/git/project and and you issue a command as un tracked and git rm --cached project/foo/bar.

If bar is open anywhere (Explorer, eclipse or anywhere else) file will remain as un tracked

forvaidya
  • 3,041
  • 3
  • 26
  • 33