How can you remove a file from a Git repository without deleting it from your file system?

  • git delete
  • git remove
  • git rm
  • git detach
The git rm command is used to remove a file from both the working directory and the staging area. However, when used with the --cached option, it only removes the file from the staging area, leaving the working directory and the file system unchanged. This is useful for untracking a file without deleting it.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *