1

gitとRailsを使用した希望のセットアップについてアドバイスが必要です。

基本的に、最初のRailsアプリケーションでは、GitHubの基本アプリケーションテンプレートを使用しました。その後、大量の変更を加え、かなりカスタマイズされた完全なアプリケーションを作成しました。

これで、ベースアプリケーションテンプレート内のファイルに加えたすべての変更を抽出し、変更をgithubリポジトリのフォークにコミットしました。理想的には、ベースアプリケーションテンプレートをアプリケーションのブランチとして使用し、マスターを使用してリベースしたいと思います。これは実際に可能ですか?

これを実行したい理由:ベースアプリケーションを最新の機能に保ちたいので、次のプロジェクトでは、githubフォークからベースアプリケーションテンプレートのクローンを作成して作業を開始できます。同様に、誰かがベースアプリケーションテンプレートのバグを修正した場合、それらの修正を、ベースアプリケーションテンプレートをブランチとして持っているアプリケーションとマージできますか?

これは可能ですか?これを行うためのより良い/より一般的な方法はありますか?

前もって感謝します!

ありがとう、

ダニー

4

1 に答える 1

1

これは興味深いアイデアですが、一連の更新に加えてプロジェクト履歴全体をリベースすることは、想像以上に難しいかもしれません。

これがpseudo-gitでそれを行う方法です:-)

# First fork the app template on github
# Then clone it locally
git clone your_fork_of_app_template_url

# Setup a remote to the original repository (the one you forked from)
git remote add original_base original_app_template_url

# make a branch at the root so you have someplace to pull in new changes
git checkout -b app_template original_base/master

# go back to your master and write your app
git checkout master
git commit
git commit 
...

# Then later update your app template if it has changed
git checkout app_template
git pull original_base

# now Rebase your entire app on top of the updated template (not sure how to go about this with multiple branches like edge)
git checkout master
git rebase app_template

これは、アプリテンプレートが単なるgemファイルまたはプラグインのコレクションである場合に機能する可能性があります。ただし、それでも、マージするだけの方がよいmasterapp_template場合があるため、アプリの履歴全体を書き直す必要はありません。

于 2010-06-10T21:19:50.197 に答える