How to remove a file from the "git add " index if it has not yet been commited to the master branch.
I do not wish to actually delte the file itself ,just remove it from the index. TIA
How to remove a file from the "git add " index if it has not yet been commited to the master branch.
I do not wish to actually delte the file itself ,just remove it from the index. TIA
git reset filepath
This will remove the file from add index and the changes will remain on your local system.
You simply have to delete it form the index using this simply rrm command:
git rm --cached <file name>
If you will use
git rm <file>
it will remove it from both your file directory and your index, using the --cache
flag will only remove it from your index.
Once you have removed the file you have to commit the change so use the git commit --ammend
to modify the last commit.
It will remove the file from the last commit along side with all other changes which you have made.