そこで、数日前にGitを使い始めました。(パーティーに非常に遅れています-叱らないでください:))。基本的なコマンド、アイデア、ワークフローに本当に慣れ始めています。しかし、サブモジュールは本当に私の頭脳を乗せています。私はFuelPHPのGitHubにコードを提供しようとしていますが、いくつかのガイダンスとヒントを使用できます。
ターミナルで次のコマンドを実行しています。
//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
具体的には、私の質問は次のとおりです。
- これは、サブモジュールを操作するための適切なワークフローですか?それはあなたがすることですか?
- なぜgit
1.1/developはサブモジュールのブランチをプルダウンしますが*no branch、デフォルトでオンに設定しているのですか?この動作を変更できますか? - 燃料サブモジュールのどの部分がgitに1.1/developを最初にプルするように指示しますか?他のブランチ(
1.1/masterなど1.0/develop)があります。 - ステップ11で1日と呼べないのはなぜですか?サブモジュールプッシュは正常に機能しました。マニュアルにいいアイデアだと書いてあるので、後でスーパーをプッシュします。そして実際、GitHubに向かい、MYスーパーを見ると、コミットが行われます。ただし、このコミット845de87は、MYスーパーではなく、Fuelのスーパーへの単なる参照であるように見えます。彼らのレポではなく、私のレポにリンクするべきではありませんか?
cat .git/configスーパーショーでの実行:
すべてのサブモジュールとともに...
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git://github.com/fuel/fuel.git`
コアサブモジュールで実行cat .git configすると、次のようになります。
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git://github.com/fuel/core.git
これらのURLをGitHubの自分のリポジトリに変更するのが賢明でしょうか?とにかく燃料はプッシュを拒否します。サブモジュールの更新を実行すると、それらは上書きされますか?
私はFuelのフォーラムでもこれについて質問しましたが、それはより一般的な質問であり、ここにはもっと多くのGittersがあります...ありがとう!