First, use the git RM command
1. Preview the file you want to delete
Execute git rm-r-n--cached "bin/" , which shows the file table preview to be deleted
2. Remove version Control actions
Execute git rm-r--cached "bin/" to delete the file's command.
Execute git commit-m "Delete bin file" , submit and annotate
execute GIT push Origin master , submit to remote server
Note: This deletion retains the local file if the delete server file can not use push.
When we need to delete a file on a registers or branch, and the workspace does not need this file , you can use the
1 git rm file_path
2 git commit-m ' delete somefile '
3 git push
When we need to delete the file on the registers or branch, but we need to use it locally, we just don't want this file to be version controlled, you can use
git rm--cached file_path
git commit-m ' delete remote somefile '
git push
More:
Git back to the specified version command
Use Git to get the latest version to the local
To delete a remote branch on a github