One of the popular options to deploy something nowadays is git-based deployment (Github pages is a good example). Here’s a recipe to push some content to the remote branch ignoring whatever this branch already has:
In this snippet:
- The directory
- Within that directory, a current time is echoed to
- Then, a brand new git repository is created, the entire folder contents are added and committed to the local
- After it comes a trick: we take the local
masterand push it to the remove
See the demo repository here.