Reputation: 51
I've got a question.
I want to remove all of the files from remote
that are not in current commit. e.i. clean the remote to current commit.
Example:
Local Host:
Directory:
- folder 1
-- file 1
-- fiel 2
- folder 2
-- file 1
Remote:
Directory:
- folder 1
-- file 1
-- fiel 2
- folder 2
-- file 1
- folder 3
-- file 1
-- fiel 2
Such that I would delete anything that is not in on my local host, not in my commit. In this case Folder 3
and files would be deleted from remote.
Upvotes: 0
Views: 91
Reputation: 522762
The only way you could arrive at your current working directory which is sans a "folder 3" would be if you deleted that folder in the current commit, or some previous commit. When you push your commit(s), you are also pushing the instruction to delete "folder 3" on the remote.
In case you are still in doubt, the remote file structure just reflects whatever the structure is in the HEAD or latest commit. If "folder 3" be not present there, then it will not show up on the remote.
Upvotes: 1