Note that there are some explanatory texts on larger screens.

plurals
  1. POhow do I deploy multiple branches to different directories via git push?
    text
    copied!<p>In production, I maintain two sites - beta and release. Each points to a different directory via a soft link (e.g.)</p> <pre><code>beta_public_html -&gt; /home/scott/myapp/trunk/public public_html -&gt; /home/scott/myapp/branches/1.2.3/public </code></pre> <p>I'm a longtime svn user, moving to git. I'm used to deploying via svn update and changing the soft link on a new branch, things are pretty simple.</p> <p>Now I'm moving to git. I still need to have the two soft links (it's a Rails app using Passenger), though now I want them to point to two different git branches ("beta" and "release", say). And I want to be able to update them via git push (or git pull).</p> <p>Question Part 1: I'm not sure the best way to do this.</p> <p>The way I had started to do it was to just deploy to two different remotes, e.g.</p> <pre><code>git push ssh://scott@x.com/home/scott/myapp-beta beta git push ssh://scott@x.com/home/scott/myapp-release release </code></pre> <p>But this doesn't work because push doesn't update the working tree by default. </p> <p>So I go into the remote directories and run git reset --hard the first time, and it pulls the working tree. But I push again and I can't get the new push to show up - it just stays at the initial one.</p> <p>(BTW, note that I can't seem to push to "myapp-beta.git" - that fails, I have to push to the directory name. I am worried that this is part of the problem, but I don't know what I did wrong here.)</p> <p>So, if the answer to Question 1 is that my method is fine, Question Part 2: what's wrong with what I'm actually doing? If there are hooks I should be using, can someone point me to them?</p> <p>(An answer to Question 1 that says "run these seven manual steps" will not be a terribly useful answer, seeing as svn checkout + ln -s are two steps.)</p> <p>Thanks. I want to get back to writing code.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload