Reputation: 2155
I have push the commited files to the remote server host.But the files is that I need to delete.How can I delete the files from remote server.
Upvotes: 0
Views: 380
Reputation:
two ways can do it.
ONE:
in your local directory operation.
git rm FILENAME
git commit -m "WRITE SOMETHING"
git push origin master
#or your using branch
TWO:
in your local directory type flow:
git remote rm FILENAME
git commite -m "WRITE SOMETHING"
git push origin master
#or your using branch
Upvotes: 1
Reputation: 26331
If you pushed stuff that you don't want to show up in your history (passwords, swearing etc.), you can also re-write the history. But this should only be an emergency measure and can make people angry at you if they already pulled from that branch. Locally you can use git rebase -i
to modify your history, and then push it with git push REMOTE +BRANCH
(where REMOTE
and BRANCH
refer to the remote and branch names, respectively). If you want to delete the remote branch, use git push REMOTE :BRANCH
. Notice that depending on your rights on the server (as e.g. implemented by gitolite), you are not able to rewrite the history on the server.
If it is passwords that you pushed, make sure to change them nonetheless, people might already have seen them!
Upvotes: 1