Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy isn't a 'git fetch' from within the submodule necessary before a 'git submodule update'?
    primarykey
    data
    text
    <p>We have Wordpress installed as a submodule in our web project. We are a team of 5 with a shared repo. The production server is deployed from the master branch of the shared repo. </p> <p>When I or another team member wants to update the wordpress core we cd into the wordpress submodule on our local machine and run 'git fetch' followed by checkout version. We then commit the change in the super project and push the commit to the shared repo. </p> <p>However when we deploy our website on the production server the Capistrano deployment script fails with:</p> <pre><code>fatal: reference is not a tree </code></pre> <p>The deployment script runs the following commands:</p> <pre><code>git fetch -q origin git fetch --tags -q origin git reset -q --hard (latest commit) git submodule -q init git submodule -q sync export GIT_RECURSIVE=$([ ! \"`git --version`\" \\&lt; \"git version 1.6.5\" ] &amp;&amp; echo --recursive) git submodule -q update --init $GIT_RECURSIVE git clean -q -d -x -f </code></pre> <p>From my research I believe the tree object which the commit references does not yet exist within the submodule on the web server. I would assume then that the deployment script needs an extra step which first cd's into the submodule folder and runs a 'git fetch' before the 'git submodule update' command is run. However I can't find anyone else using 'git fetch' in their submodule workflow. What am I missing? Is the solution to add the '--recurse-submodules' switch to the 'git fetch' commands?</p> <p><strong>UPDATE</strong> I thought the problem may be related to the version of git (1.7.1 on Centos 6) running on the server so we upgraded to 1.7.11 but the problem still persists.</p>
    singulars
    1. This table or related slice is empty.
    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.
    1. This table or related slice is empty.
    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