checkout - Checked out an old revision in git, then returned to latest revision, but deleted files from old revision are still in local directory? -
while using git, checked out specific revision in master branch:
checkout <branch hash> .
i did take @ previous files, made no changes. attempted reset current state latest revision. unfortunately attempted several commands because wasn't sure if worked; commands included:
checkout master .
checkout head .
reset head --hard
i wasn't sure if worked @ first because of behavior indicated previous file of old revision present.
i realized modified , new files indeed restored current revision, files deleted between old revision , current revision still in local directory. supposed occur? imagine no 1 want old, deleted files present after returning current revision, , yet appears case.
i wondering if did wrong occur or if there command can use remove these unwanted files of temporarily checked out revision?
see: git: when checking out alternative branch, want clear ignored files
i believe you're looking git clean
command. if quick git clean -nd <path>
, list un-tracked / deleted files deleted upon real run of command.
if you're sure includes files want delete, perform git clean -df <path>
.
reference: http://gitready.com/beginner/2009/01/16/cleaning-up-untracked-files.html
Comments
Post a Comment