我不想將特定的文件夾合併到另一個分支。Git屬性合併我的
前)sample_folder/* merge=ours
在單個文件,index.php merge=ours
工作正常。但不知道如何將其應用於文件夾內的文件。
我不想將特定的文件夾合併到另一個分支。Git屬性合併我的
前)sample_folder/* merge=ours
在單個文件,index.php merge=ours
工作正常。但不知道如何將其應用於文件夾內的文件。
這應該是足夠了:
sample_folder/ merge=ours
的一些設置也可爲指定的路徑,這樣的Git只爲一個子目錄或子應用這些設置的文件
由於Merge Strategies只提及文件,您可能需要調整文件sel ector
sample_folder/*/* merge=ours
# or
sample_folder/**/** merge=ours
另請參閱http://stackoverflow.com/a/14931416/6309 – VonC
我使用gitignore和gitattributes進行了測試,並且gitignore在樹結構中工作正常。但是,gitattributes根本無法使用文件夾結構。我試圖 sample_folder/ sample_folder/** sample_folder/* sample_folder/test.php的 sample_folder /sample_folder /sample_folder/ 他們都沒有工作.... 我錯過了什麼? –
@SangLee你使用的是什麼版本的git? – VonC
我嘗試了與單個文件相同的方式,但它不適用於我。只是想知道如果我失蹤了! – Athar