Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I add/upgrade/downgrade a remote Git project in my repository without using submodules?
    primarykey
    data
    text
    <p>I need to keep a copy of WordPress in my project's Git repository.</p> <p>I want to use Git to pull down WordPress updates from GitHub, and then push out those updates via <code>git push</code> and/or <code>git svn dcommit</code>.</p> <p>I currently have a solution in place using Git submodules, and it works; but now I need to deploy my newest project to a server that only supports SVN, and to which I have no direct access whatsoever. Therefore, submodules are out.</p> <p>I've done a ton of reading on <a href="http://git-scm.com/book/en/Git-Tools-Subtree-Merging" rel="noreferrer">Git's subtree merging strategy</a>, and I think it's the right solution; but everything I've read expects that I'd want to follow a remote branch, and always pull down its most recent code.</p> <p>On the contrary, <a href="https://github.com/WordPress/WordPress" rel="noreferrer">WordPress on GitHub</a> uses its <code>master</code> branch – in fact, all of its branches – for development; releases are tagged, but that's it. Officially speaking, all branches are in a perpetual alpha state.</p> <p>I think what I need to figure out is how to subtree merge a <em>tag</em>.</p> <p>Right now, I'm doing this to read WordPress 3.5 into <code>webroot/wordpress</code> (and to namespace WordPress tags), and it works:</p> <pre><code>$ git remote add -t master --no-tags wordpress git://github.com/WordPress/WordPress.git $ git config --add remote.wordpress.fetch +refs/tags/*:refs/tags/wordpress/* $ git fetch wordpress warning: no common commits remote: Counting objects: 138547, done. remote: Compressing objects: 100% (28297/28297), done. remote: Total 138547 (delta 110613), reused 137367 (delta 109624) Receiving objects: 100% (138547/138547), 46.05 MiB | 2.26 MiB/s, done. Resolving deltas: 100% (110613/110613), done. From git://github.com/WordPress/WordPress * [new branch] master -&gt; wordpress/master * [new tag] 1.5 -&gt; wordpress/1.5 ... * [new tag] 3.5 -&gt; wordpress/3.5 * [new tag] 3.5.1 -&gt; wordpress/3.5.1 $ git read-tree --prefix=webroot/wordpress/ -u wordpress/3.5 $ git commit -m "Added WordPress 3.5 at webroot/wordpress" [master c483104] Added WordPress 3.5 at webroot/wordpress 1061 files changed, 269102 insertions(+) create mode 100644 webroot/wordpress/index.php create mode 100644 webroot/wordpress/license.txt create mode 100644 webroot/wordpress/readme.html ... </code></pre> <p>No matter what I try, though, I can't figure out how to use subtree merging to update this with WordPress 3.5.1.</p> <p>Trying <code>merge</code> and <code>read-tree</code>, as per <a href="http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html" rel="noreferrer">this</a>, doesn't work:</p> <pre><code>$ git merge -s ours --squash --no-commit wordpress/3.5.1 Squash commit -- not updating HEAD Automatic merge went well; stopped before committing as requested $ git read-tree --prefix=webroot/wordpress/ -u wordpress/3.5.1 error: Entry 'webroot/wordpress/index.php' overlaps with 'webroot/wordpress/index.php'. Cannot bind. </code></pre> <p>Trying a subtree merge fails:</p> <pre><code>$ git merge -s subtree --squash --no-commit wordpress/3.5.1 warning: Cannot merge binary files: webroot/wordpress/wp-includes/js/tinymce/wp-tinymce.js.gz (HEAD vs. wordpress/3.5.1) ... Squash commit -- not updating HEAD Automatic merge failed; fix conflicts and then commit the result. </code></pre> <p>(<code>git pull -s subtree --squash --no-commit wordpress 3.5.1</code> fails the same way.)</p> <p>I've tried adding <code>-Xtheirs</code> to <code>git merge</code>, I've tried a recursive <code>merge</code> with <code>-Xsubtree</code>, I've tried every combination of temporary branches and subtree merging that I can figure out – but I can't seem to crack this.</p> <p>Any ideas? Or should I just give up and download (and re-download, and re-download) WordPress the old-fashioned way?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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