With mercurial I nearly did a similar thing, working on my own but committing from two different machines. Luckily mercurial gave me a warning that allowed me to make sense of what I was doing. Not sure how this works with git but here goes.<br>
<br>1. I push from laptop1 to my central server. All is good.<br>2. I push from laptop2 to my central server. Mercurial doesn&#39;t allow this and warns me that the remote repo will have two heads (which is allowed but probably not what I want). I can override this with --force.<br>
3. Oh silly sod - of course I committed from the other machine.<br>4. I <span style="font-style: italic;">pull</span> from the central server, merge locally and commit, creating a new single head representing the merge<br>
5. I then push the result, meaning there is only ever a single head/tip/edge/whatever in the repository.<br>6. I realise that this is what I always do with subversion anyway - update, merge, [run tests], commit.<br><br>It seems git doesn&#39;t protect you from yourself like hg does - which is understandable, it&#39;s designed for and used by scarier people!<br>
<br>Could a pull-merge-commit before pushing have avoided this, and should we make that our endorsed way of working? Or am I missing something else about how dscm works?<br><br>Cheers,<br>Dan<br><br><br><div><span class="gmail_quote">On 18/04/2008, <b class="gmail_sendername">Pat Maddox</b> &lt;<a href="mailto:pergesu@gmail.com">pergesu@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, Apr 17, 2008 at 9:01 AM, Jonathan Leighton<br> &lt;<a href="mailto:j@jonathanleighton.com">j@jonathanleighton.com</a>&gt; wrote:<br> &gt; On Thu, 2008-04-17 at 08:49 -0400, David Chelimsky wrote:<br> &gt;&nbsp;&nbsp;&gt; This all make sense?<br>
 &gt;<br> &gt;&nbsp;&nbsp;Ok, I have to confess I haven&#39;t been paying that much attention to the<br> &gt;&nbsp;&nbsp;way things are or were set out on github, so let me see if I&#39;m fully<br> &gt;&nbsp;&nbsp;understanding what you&#39;re saying...<br>
 &gt;<br> &gt;&nbsp;&nbsp;Was &quot;rspec&quot; previously split up into several repositories, with a<br> &gt;&nbsp;&nbsp;&quot;parent&quot; repository which contained the other repositories as<br> &gt;&nbsp;&nbsp;submodules? So you are essentially saying that it is a bad idea to split<br>
 &gt;&nbsp;&nbsp;one single project into a number of pieces and manage that project<br> &gt;&nbsp;&nbsp;through submodules? However, you do consider submodules to be a good<br> &gt;&nbsp;&nbsp;idea if you are using and wish to track third-party upstream code, for<br>
 &gt;&nbsp;&nbsp;example plugins in a Rails project?<br> <br> <br>RSpec was split into four repos...and it still is actually.&nbsp;&nbsp;But<br> originally the rspec-dev project was a superproject that included the<br> other three as submodules.<br>
 <br> The problem with submodules is if two people are making changes to the<br> submodules at the same time.<br> <br> Let&#39;s say I work on the rspec submodule, and my final commit is<br> abc123.&nbsp;&nbsp;You work on the rspec submodule as well and your final commit<br>
 is def456.&nbsp;&nbsp;The superproject tracks the head of each submodule,<br> meaning we each need to commit a reference to the heads of rspec.&nbsp;&nbsp;At<br> some point you pull from my...and the incoming commits say that the<br> head is abc123, but you say def456.&nbsp;&nbsp;merge conflict.&nbsp;&nbsp;Not a big deal,<br>
 since you have all the latest code, so you can safely point it at<br> def456.&nbsp;&nbsp;But it&#39;s a bit of a hassle because you have to do that every<br> single time.&nbsp;&nbsp;I don&#39;t actually know what all the potential problems<br>
 are, but beyond just the hassle, it seems very easy for someone to<br> make a mistake, causing a lot of headaches.<br> <br> We still have stuff split up, but we realized there&#39;s no reason for<br> the rspec-dev repo to track the others as submodules.&nbsp;&nbsp;We wrote a rake<br>
 task to check out all the other repos beneath the rspec-dev dir.&nbsp;&nbsp;It&#39;s<br> basically the exact same setup, but without the submodule tracking.<br> And it avoids any problems with submodules, because it&#39;s all just<br>
 standard git push/pull/merge stuff.<br> <br><br> Pat<br> <br>_______________________________________________<br> rspec-users mailing list<br> <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br> <a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
 </blockquote></div><br>