Reputation: 453
I have a web server with git and we are 3 working on it. I want to know what is the way to pull my git repository directly from an URL. I know it's possible because I have worked on a server configurated like that. You just had to access to an URL, protected by htaccess (whatever) which execute the pull.
Is that just an exec in PHP? Or is there a better way? I also want to know the process to do the same with a Macro executable in teraterm (or teraterm like)
It should probably already have some similar question (like this one How to update my server files from a git repo automatically everyday) but it's not exacly the result that I want.
Regards
Upvotes: 0
Views: 149
Reputation: 2158
Since everyone is working on the same git repo as you mentioned, I assume you've pretty much setup the git server then. That means your origin on your local should be pointing to something like [email protected]:myproject/myproject.git. You can use this for push/pull from any remote clients (you will need use public IP and setup proper firewall for public network). You just need to install Git on the remote client, use that address as remote origin, clone repo, and pull whenever you need. You can schedule/cron this if you like. You could also use PHP to execute this command just like any other shell command as well.
Since you mentioned URL, you could setup HTTP instead of SSH. If this is what you're looking for, might as well look into GitLab. It has a nice web interface which lets you manage projects inside the server, view commits, manage issues, merge requests, manage user/team access, etc.
Upvotes: 1