2

I have tried reset but it doesn't work.how to change a file to untracked?

git status
   untracked files:
   bin
   gen

git add gen
git status
   untracked files:
   bin

git reset gen
git status
   untracked files:
   bin

it doesn't work.is the command right?how to change a file to untracked?

4

2 回答 2

4
git rm --cache gen

does not delete the file, but change to untracked

于 2012-09-05T03:29:48.450 回答
1

Did you try using ?

git rm gen

I think that is what you want. Or you can simply rm the file. This will remove the file, but if it is on a different branch then you change branch and it will return. Alternatively you could mv the file out of the tracked directory if you are worried about losing it ie.

mv gen /tmp

I also recommend using gitx app strongly you can just shift things from stagged to unstagged with a double click.

于 2012-09-05T03:20:23.423 回答