Is it possible to deploy a website using git push
? I have a hunch it has something to do with using git hooks to perform a git reset --hard
on the
Update: I'm now using Lloyd Moore solution with the key agent ssh -A ...
. Pushing to a main repo and then pulling from it in parallel from all your machines is a bit faster and requires less setup on those machines.
Not seeing this solution here. just push via ssh if git is installed on the server.
You'll need the following entry in your local .git/config
[remote "amazon"]
url = amazon:/path/to/project.git
fetch = +refs/heads/*:refs/remotes/amazon/*
But hey, whats that with amazon:
? In your local ~/.ssh/config you'll need to add the following entry:
Host amazon
Hostname
User
IdentityFile ~/.ssh/amazon-private-key
now you can call
git push amazon master
ssh @ 'cd /path/to/project && git pull'
(BTW: /path/to/project.git is different to the actual working directory /path/to/project)