Staging Deleted files



  • 3 Answer(s)

    Use git rm foo to stage the file for deletion from the file system to be restored from git.

    Use git rm –cached foo¬†file for deletion without deleting it from the file system.

    Answered on January 4, 2019.
    Add Comment

    git add -u:

    Erase multiple files, without doing git rm

    Answered on January 4, 2019.
    Add Comment

    Manually deleted files:

    git rm $(git ls-files --deleted)
    
    

    This command as git rm-deleted

    git config --global alias.rm-deleted '!git rm $(git ls-files --deleted)'
    
    
    Answered on January 4, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.