简体   繁体   中英

git how to remove all files which is not in directory and git add --all again

I just renamed a lot of files, eg myfile.php to Myfile.php . And realised that git ls-files shows old filenames. So I run git add --all and git add , git commit and git push etc. Then I realised that there are old and new files in my git repo and git ls-files.

Is there any way I can remove all git files and add again?

First run

git reset --soft

and then

git diff

to see the files that have changed.

After that add the files you want to commit and do git commit -m

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM