I want to know is possible to sync from local git repository to remote server.
- I have git repository in our server on LAN
- I have a git repository in Remote server like Godaddy or Amazon.
Is it possible to sync changes files from LAN git repository server to remote server repository for get updated files from any where? (Outside office)
Please provide any methods are available.
If you have contrĂ´le over the remote repository on your LAN, you could use a post-receive hook that will push to the external repo each time you push to the LAN repo :
First
ssh
to the server on your LAN andcd
into the remote bare repo (eg :your-repo.git/
). Then create an executable file namedpost-receive
inhooks/
folder and paste this content inside :That way, the external remote repo will always be in sync with the LAN remote repo.
I can provide further explanations if in addition you want to push changes directly into the external remote repo.