2010-02-03 74 views
1

沿着相同的路線,因爲這問題 - How do I clone all remote branches with Git?,如果我已經設置了Github上庫,像這樣:兩個Git倉庫的項目部分 - 如何忽略不同的文件?

$ git clone [email protected]:viatropos/spree.git mycart 
$ cd mycart 
$ git branch 
* master 
$ git remote add origin [email protected]:viatropos/mycart.git 
fatal: remote origin already exists. 
$ git remote add myfork [email protected]:viatropos/mycart.git 
$ git branch -a 
* master 
    origin/0_8_5 
    origin/0_9_2 
    origin/494-rake-task-for-default-data 
    origin/598-ruby-19 
    origin/611-refactor-charges-to-use-calculators-and-be-polymorphic 
    origin/811-refactor-payment-gateways 
    origin/HEAD 
    origin/master 
    origin/nested_attributes 
    origin/slicehost 
    origin/taxonomy_landing 
    origin/v9_592_tmp 
$ git checkout -b slicehost origin/slicehost 
Branch slicehost set up to track remote branch refs/remotes/origin/slicehost. 
Switched to a new branch "slicehost" 
$ git branch 
    master 
* slicehost 

...我如何使它所以原來[email protected]:viatropos/spree.git項目忽略了供應商/擴展什麼目錄,而[email protected]:viatropos/mycart.git項目沒有,因爲只有這個主項目/目錄(mycart)?

回答

1

您的意思是.gitignore通過「忽略...中的任何內容」?此文件也是版本控制的,因此您可以將供應商/擴展程序添加到一個分支上的.gitignore,並在另一個分支上刪除它。