Skip to main content
added 17 characters in body
Source Link
Anshul Goyal
  • 78k
  • 42
  • 162
  • 196

One way is to use rm -rf *, which will delete all files from the folder except the dotfiles and foldersdotfolders like .git. You can then delete the dotfiles and dotfolders one by one, so that you don't miss out on anyimportant dotfiles like .gitignore or, .gitattributes or any other important dotfile later.

Another approach would be to move your .git folder out of the directory and then going back and deleting all the contents of the folder and moving the .git folder back.

mv .git/ ../ cd .. rm -rf folder/* mv .git/ folder/ cd folder 

One way is to use rm -rf *, which will delete all files from the folder except the dotfiles and folders. You can then delete the dotfiles one by one, so that you don't miss out on any .gitignore or .gitattributes or any other important dotfile later.

Another approach would be to move your .git folder out of the directory and then going back and deleting all the contents of the folder and moving the .git folder back.

mv .git/ ../ cd .. rm -rf folder/* mv .git/ folder/ cd folder 

One way is to use rm -rf *, which will delete all files from the folder except the dotfiles and dotfolders like .git. You can then delete the dotfiles and dotfolders one by one, so that you don't miss out on important dotfiles like .gitignore, .gitattributes later.

Another approach would be to move your .git folder out of the directory and then going back and deleting all the contents of the folder and moving the .git folder back.

mv .git/ ../ cd .. rm -rf folder/* mv .git/ folder/ cd folder 
added 105 characters in body
Source Link
Anshul Goyal
  • 78k
  • 42
  • 162
  • 196

One way is to use rm -rf *, which will delete all files from the folder except the dotfiles and folders. You can then delete the dotfiles one by one, so that you don't miss out on any .gitignore or .gitattributes or any other important dotfile later.

Another approach would be to move your .git folder out of the directory using andand then going back and deleting all the contents of the folder and moving the .git folder back.

mv .git/ ../ cd .. rm -rf folder/* mv .git/ folder/ cd folder 

One way is to use rm -rf *, which will delete all files from the folder except the dotfiles and folders. You can then delete the dotfiles one by one.

Another approach would be to move your .git folder out of the directory using and then going back and deleting all the contents of the folder and moving .git back.

mv .git/ ../ cd .. rm -rf folder/* mv .git/ folder/ cd folder 

One way is to use rm -rf *, which will delete all files from the folder except the dotfiles and folders. You can then delete the dotfiles one by one, so that you don't miss out on any .gitignore or .gitattributes or any other important dotfile later.

Another approach would be to move your .git folder out of the directory and then going back and deleting all the contents of the folder and moving the .git folder back.

mv .git/ ../ cd .. rm -rf folder/* mv .git/ folder/ cd folder 
Source Link
Anshul Goyal
  • 78k
  • 42
  • 162
  • 196

One way is to use rm -rf *, which will delete all files from the folder except the dotfiles and folders. You can then delete the dotfiles one by one.

Another approach would be to move your .git folder out of the directory using and then going back and deleting all the contents of the folder and moving .git back.

mv .git/ ../ cd .. rm -rf folder/* mv .git/ folder/ cd folder