I have a remote branch that contains certain files I would like to remove. I want the removal to be done for both the local and remote repository. Is there a way to do this without the deleted files showing in my commits as deleted files with the red background
It's possible, but only for repositories you control. If someone already downloaded a copy of the repo with the deleted files, needless to say, you can't do anything about it.
It is possible to remove a file from the entire history of the project, then force-push to the remote repository.
If there are other users pulling from the repo, all their future merges will become messy. Proceed with caution:
If you want to remove the deleted files from the output of git diff or git log -p, all you have to do is passing the --diff-filter=M argument. This will tell Git to display only modified files. Check the git-diff man page for details.
Emanuel Quimper
Golang | Javascript | Elixir
For the deleted file with the red background, I dont think this is possible, but if you want to deleted the file remotely you need to run
git rm pathtoourfilehere git add . git commit -m 'Delete my file' git push`