1
我一直在最近擺脫git submodules的過程。有時我會在有子模塊的地方添加新文件。如何用代碼中的自動代碼替換git子模塊?
我正在尋找一種很好的方式來刪除一個子模塊,並在它的位置添加一些文件,而不會產生合併問題來拉取用戶。
這裏就是我說的:
這是一個承諾,我已經刪除的子模塊定義和增加了一些文件作爲替代:
$:~/src/github/huerlisi/mailyt$ git show d1e7e1276fdccb37f775c8f656077e490a0b7be8
commit d1e7e1276fdccb37f775c8f656077e490a0b7be8
Author: Simon Hürlimann (CyT) <[email protected]>
Date: Wed May 11 22:07:49 2011 +0200
Vendor in formtastic sass, drop git submodule.
diff --git a/.gitmodules b/.gitmodules
index 24f8f38..e6177d1 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
[submodule "vendor/plugins/fetcher"]
path = vendor/plugins/fetcher
url = git://github.com/huerlisi/fetcher.git
-[submodule "app/stylesheets/partials/formtastic"]
- path = app/stylesheets/partials/formtastic
- url = git://github.com/activestylus/formtastic-sass.git
diff --git a/app/stylesheets/partials/formtastic b/app/stylesheets/partials/formtastic
deleted file mode 160000
index 1b920cb..0000000
--- a/app/stylesheets/partials/formtastic
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 1b920cb2db627cb7cf11cf4d3cea373a774a6fd3
diff --git a/app/stylesheets/partials/formtastic/_formtastic_base.sass b/app/stylesheets/partials/formtastic/_formtastic_base.sass
new file mode 100644
index 0000000..b01ac8e
--- /dev/null
+++ b/app/stylesheets/partials/formtastic/_formtastic_base.sass
@@ -0,0 +1,652 @@
+//
+// FORMTASTIC SASS
+// Flexible styling for formtastic forms
合併這個承諾與我的工作目錄子模塊簽出給出了這樣的錯誤:
~/src/github/huerlisi/mailyt$ git pull
remote: Counting objects: 35, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 24 (delta 16), reused 0 (delta 0)
Unpacking objects: 100% (24/24), done.
From github.com:huerlisi/mailyt
2d055d6..82a45be master -> origin/master
* [new branch] notmuch -> origin/notmuch
Updating 2d055d6..82a45be
error: The following untracked working tree files would be overwritten by merge:
app/stylesheets/partials/formtastic/_formtastic_base.sass
Please move or remove them before you can merge.
Aborting
合併作品之前,手動刪除應用/樣式表/諧音/ formtastic目錄。但是,我希望我的同行編碼人員能夠簡單地進行拉取和編碼。
好,你告訴我我期待什麼。我仍然希望有一個醜陋的黑客...所以你將不得不等待一天左右'直到我最終接受你的答案(不要拍信使,他們說:-) – 2011-05-12 08:14:58
強迫他們克隆併合並他們原有回購的任何變更。對於這些回購,子模塊從來不存在,並且您避免了這個問題 – 2011-05-12 15:54:34
看起來像(特別是丟棄)子模塊需要在回購站旁邊有一個額外的通信通道。就這樣吧:-) – 2011-05-12 17:30:28