Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Git Workflow Advice.
  • Hey Fuelers, I'm a newcomer to the whole git thing (shame on me!) - Hoping you all could shine some light or guide me in the right direction.
    I've spent the last two or three days absorbing as much git information as I possibly can - the commands are beginning to make sense, as with the workflow.
    However, as you all know, submodules are kind of a bitch to a newb; so I'm trying to wrap my head around the best way to interact with fuel's github. Is this wise? I'm beginning to think it's probably much more efficient to just clone the individual repos and work on them seperately.
    Could you git pros take a look at my commands (to edit a single file inside a submodule) and give me pointers as to how I should adjust my workflow?
    //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 seperately ( [url=http://book.git-scm.com/5_submodules.html]http://book.git-scm.com/5_submodules.html[/url] )
    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
    

    Furthermore, I'd also like to ask... If I run git branch after line 5, I'll get:
    * (no branch)
      1.1/develop
    

    Is there a way I can ensure it selects 1.1/develop by default?
    Forgetting to checkout a branch lends itself to those detatched head errors and whatnot?
    That's provided I'm approaching this right in the first place.
    Also, Where does it get this 1.1/develop from? I don't see the other branches there. Awesomesauce, Thanks much!
    Time to FUEL up on some sleep. Update: This question has been asked on StackOverflow as well:
    http://stackoverflow.com/questions/9411380/git-submodule-workflow-advice

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!