私は数日前にGitを使い始めました。 (パーティーには非常に遅いです - 叱らないでください:))。本当に基本的なコマンド、アイデア、ワークフローに慣れ始めています。しかし、サブモジュールは本当に私の脳を乗り越えています。 FuelPHPのGitHubにコードを提供しようとしていますが、私はいくつかのガイダンスとヒントを使用できます。Gitサブモジュールワークフローアドバイス
私は、ターミナルで以下のコマンドを実行しています:
//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 [email protected]: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 [email protected]:jordanarseno/fuel.git
は具体的には、私の質問は以下のとおりです。
- これはサブモジュールで作業するための適切なワークフローですか?それはあなたがするだろうか?
- gitはなぜサブモジュール内の
1.1/develop
ブランチをプルダウンするのですか?デフォルトでは*no branch
に設定されていますか?この動作を変更できますか? - 燃料サブモジュールのどの部分がgitに1.1を引き出すように指示しますか? は、他の枝(
1.1/master
、1.0/develop
など)です。 - なぜステップ11でそれを1日と呼びますか?サブモジュールプッシュは正常に機能しました。私は後でマニュアルをtells me it's a good ideaのためにスーパーを押す。実際、GitHubに向かい、私のスーパーを見ると、コミットされます。しかし、This commit 845de87は、燃料スーパーのものであり、私のスーパーのものではないようです。私のレポにリンクしてはならないのですか?
- スーパーショーで
cat .git/config
の実行:すべてのサブモジュール...コアサブモジュールでcat .git config
を実行[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git://github.com/fuel/fuel.git`
とともに
は示しています
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git://github.com/fuel/core.git
それはに賢明だろうこれらのURLをGitHubの自分のレポに変更しますか?燃料はとにかくプッシュを拒否します。サブモジュール更新を実行すると、それらは上書きされますか?
私はまたFuel's Forumsにこれを依頼しましたが、それは一般的な質問のほうが多く、ギターがたくさんあります...ありがとう!
ありがとう!他のスレッドで優れたポスト。再:2;サブモジュールが参照している特定のコミットをどのように見つけるか?あなたは "そのサブモジュールレポ内のブランチをチェックアウトしなければならない"と言った - それは既存の*ブランチでなければならない?私は自分で作ってそこから仕事をすることができますか?再:3;サブモジュール内で 'git branch'を実行すると、' * no branch'などが返されます。これらの「他人」がどこから来たのかは、私が疑問に思っていたものです。再:4; 2番目のgit pushを実行すると、これを達成しているはずです。失敗したと言っていますか?再:5;はい、それがアイデアでした。フォークし、次にURLを変更します。 'git submodule update'は上書きされますか? –
@ JordanArsenault:あなたのコメントに対処するために私の答えを編集しました:http://stackoverflow.com/posts/9411932/revisions – VonC