{"action":"created","issue":{"url":"https://api.github.com/repos/yyx990803/pod/issues/38","labels_url":"https://api.github.com/repos/yyx990803/pod/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/yyx990803/pod/issues/38/comments","events_url":"https://api.github.com/repos/yyx990803/pod/issues/38/events","html_url":"https://github.com/yyx990803/pod/issues/38","id":88671868,"number":38,"title":"Git branches in separate folders","user":{"login":"DQvsRA","id":442111,"avatar_url":"https://avatars.githubusercontent.com/u/442111?v=3","gravatar_id":"","url":"https://api.github.com/users/DQvsRA","html_url":"https://github.com/DQvsRA","followers_url":"https://api.github.com/users/DQvsRA/followers","following_url":"https://api.github.com/users/DQvsRA/following{/other_user}","gists_url":"https://api.github.com/users/DQvsRA/gists{/gist_id}","starred_url":"https://api.github.com/users/DQvsRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DQvsRA/subscriptions","organizations_url":"https://api.github.com/users/DQvsRA/orgs","repos_url":"https://api.github.com/users/DQvsRA/repos","events_url":"https://api.github.com/users/DQvsRA/events{/privacy}","received_events_url":"https://api.github.com/users/DQvsRA/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-16T09:22:16Z","updated_at":"2015-06-17T21:48:14Z","closed_at":null,"body":"i would like to send my project to separate folders on ec2 linux machine and run them as a simultaneous processes, its production and development. How can i do that?\r\n\r\nBest,\r\nVladimir Minkin"},"comment":{"url":"https://api.github.com/repos/yyx990803/pod/issues/comments/112960921","html_url":"https://github.com/yyx990803/pod/issues/38#issuecomment-112960921","issue_url":"https://api.github.com/repos/yyx990803/pod/issues/38","id":112960921,"user":{"login":"DQvsRA","id":442111,"avatar_url":"https://avatars.githubusercontent.com/u/442111?v=3","gravatar_id":"","url":"https://api.github.com/users/DQvsRA","html_url":"https://github.com/DQvsRA","followers_url":"https://api.github.com/users/DQvsRA/followers","following_url":"https://api.github.com/users/DQvsRA/following{/other_user}","gists_url":"https://api.github.com/users/DQvsRA/gists{/gist_id}","starred_url":"https://api.github.com/users/DQvsRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DQvsRA/subscriptions","organizations_url":"https://api.github.com/users/DQvsRA/orgs","repos_url":"https://api.github.com/users/DQvsRA/repos","events_url":"https://api.github.com/users/DQvsRA/events{/privacy}","received_events_url":"https://api.github.com/users/DQvsRA/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T21:48:13Z","updated_at":"2015-06-17T21:48:13Z","body":"I done it with git hooks like that\r\n\r\nprodpath=\"/home/ec2-user/<path_to>/production\"\r\ndevpath=\"/home/ec2-user/<path_to>/development\"\r\nwhile read oldrev newrev ref\r\ndo\r\n\tbranch=`echo $ref | cut -d/ -f3`\r\n\tif [[ \"master\" == \"$branch\" ]]; then\r\n\t\tgit --work-tree=$devpath checkout -f master\r\n\t\trestart=0\r\n\t\techo 'Changes pushed development.'\r\n\telif [[ \"production\" == \"$branch\" ]]; then\r\n\t\trestart=1\r\n\t\tgit --work-tree=$prodpath checkout -f production\r\n\t\techo 'Changes pushed to production.'\r\n\tfi\r\ndone\r\npm2 restart $restart\r\n\r\nwhere $restart may be the name of process"}}