In this tutorial you will learn about how Git rm command works and how to use it in order to delete a file in Git.
Code used during this tutorial:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# Git rm command mv file-1.txt /tmp/file-1.txt git add file-1.txt # Remove files from the working tree and from the index git rm file-1.txt git commit -m "delete file-1.txt" git rm file-2.txt ls git status git commit -m "delete file-2.txt" git log # Man page man git-rm |