Good day,
On remote server I have:
- repository /git/project.git
- clone /individual/user/project/www (remote removed)
- clone /alpha/project/www (remote is set)
- clone /stable/project/www (remote is set)
On local machine:
- clone MAMP/htdocs/project (remote is set)
I use sftp connection to /individual/user/project to see changes in real-time and merging data from /individual/user/project to /alpha/project/ and after testing to /stable/project/
Question is:
- how can i by commit+push from local machine auto-update /alpha/project/ and then if everything is fine pull changes on /stable/project/
- how can i use special branches to auto-update specific remote folders, e.g.:
- by commit+push alpha branch auto-update /alpha/project/
- by commit+push stable branch auto-update /stable/project/
- how can i pull changes for /stable/project/ from my local machine
P.S. using Terminal, SourceTree, PhpStorm, gitolite
red Pro Git 1st Edition & Pro Git 2nd Edition
It’s really possible to pull from local repo/git server to a remote server. The most important thing is you need to create a bare repo on remote server by
git init --bare
.More detail steps please refer git clone from local to remote
You can add remote to your local machine as below:
Then you can commit your local changes by
git commit -am 'message'
Push local changes to individual,alpha and stable by
git push ind && git push alpha && git push stable
If you want to pull changes to local, you can first check if it’s has remote-tracking branch by
git branch -a
. Such as if it liststable/master
, so you can directly switch to it bygit checkout stable/master
.If you want auto pushed to another repo, please refer here.