Skip to content

Instantly share code, notes, and snippets.

@PeronGH
Last active December 2, 2025 15:41
Show Gist options
  • Select an option

  • Save PeronGH/77f42ecfb5138588cc92a7dfc27bb956 to your computer and use it in GitHub Desktop.

Select an option

Save PeronGH/77f42ecfb5138588cc92a7dfc27bb956 to your computer and use it in GitHub Desktop.
Quick Remote SSH Deployment

Remote server:

git init
git config receive.denyCurrentBranch updateInstead

touch .git/hooks/post-receive
chmod +x .git/hooks/post-receive

.git/hooks/post-receive

#!/bin/bash

cd .. # because cwd is .git by default

# run build and deploy commands

Local:

git remote add production [email protected]:repos/myproject
git push production main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment