xxxxxxxxxx
# rempove file from the git repository and the filesystem
git rm file1.txt
git commit -m "remove file1.txt"
# otherwise remove the file only from git repository (NOT from the filesystem)
git rm --cached file1.txt
git commit -m "remove file1.txt"
# push the changes to remote repo
git push origin branch_name
xxxxxxxxxx
$ git rm <file>
$ git commit -m "Deleted the file from the git repository"
$ git push
xxxxxxxxxx
git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>…•