Note that there are some explanatory texts on larger screens.

plurals
  1. POGit Submodule Workflow Advice
    primarykey
    data
    text
    <p>So I started using Git a few days ago. ( <em>Very late to the party - don't scold :)</em> ). Really starting to get comfortable with the basic commands, ideas and workflows. However, submodules are really taking my brain for a ride. I am attempting to contribute code to <a href="http://fuelphp.com/" rel="noreferrer">FuelPHP</a>'s <a href="https://github.com/fuel" rel="noreferrer">GitHub</a> and I could use some guidance and tips.</p> <p>I am running the following commands in the terminal:</p> <pre><code>//1: clone the repository from Fuel's github. git clone git://github.com/fuel/fuel.git //2: move into the main fuel directory cd fuel //3: initilize the submodules (populate .git/config with submodule data) git submodule init //4: download the submodules... git submodule update //5: move into the core directory (which is a submodule). cd fuel/core //6: change branch from (*no branch) to 1.1/develop git checkout 1.1/develop //7: open random file in text editor + make some small change (i.e. typo) + save file. sudo gedit classes/autoloader.php //8: add this file to the staging area. git add classes/autoloader.php //9: commit this file under 1.1develop branch. git commit -m "im committing a submodule" //10: push the new commit to MY (not fuel's) github repo (yes i've renamed the repo). git push git@github.com:jordanarseno/fuel-core.git //11: changes are reflected on github, looks good. //12: back way out to fuel again. time to push the submodule commit separately. cd ../../ //13: add the fuel/core submodule to the staging area. git add fuel/core //14: commit the submodule change. git commit -m "submodule pushed. pushing super now." //15: push the commit to MY (not fuel's) github repo. git push git@github.com:jordanarseno/fuel.git </code></pre> <p>Specifically, my questions are:</p> <ol> <li>Is this the proper workflow for working with submodules? Is it what you would do?</li> <li>Why does git pull down the <code>1.1/develop</code> branch in a submodule but set me on <code>*no branch</code> by default? Can I modify this behaviour?</li> <li>What part of the Fuel submodule tells git to pull 1.1/develop to begin with? There <em>are</em> other branches (<code>1.1/master</code>, <code>1.0/develop</code> etc..).</li> <li>Why can't we call it a day at step 11? The submodule push worked fine. I push the super afterwards because the manual <a href="http://book.git-scm.com/5_submodules.html" rel="noreferrer">tells me it's a good idea</a>. And indeed, heading over to GitHub and looking at MY super, a commit is made. <a href="https://github.com/jordanarseno/fuel/tree/1.1/master/fuel" rel="noreferrer">This commit 845de87</a> however, appears to be just a reference to Fuel's super and not MY super. Shouldn't it link to MY repo and not theirs?</li> <li>Running <code>cat .git/config</code> in super shows:</li> </ol> <p>Along with all the submodules...</p> <pre><code>[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git://github.com/fuel/fuel.git` </code></pre> <p>Running <code>cat .git config</code> in the core submodule shows:</p> <pre><code>[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git://github.com/fuel/core.git </code></pre> <p>Would it be wise to change these url's to MY own repo on GitHub? Fuel denies pushes anyway. If I perform a submodule update, will they be overwritten?</p> <p>I've also asked this over on <a href="http://fuelphp.com/forums/topics/view/7782" rel="noreferrer">Fuel's Forums</a>, but it's more of a general question and there are more Gitters here... THANKS!</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.
 

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