I have the following fold开发者_开发知识库er structure for my project
src/
test_unit/
package1/
test_unit/
package2/
test_unit
output/
In my devel branch all folders should be version controlled, but the master/stable branch should ignore and not merge test_unit/ and output/ folder.
How can I achieve this? With .gitignore it won't work because .gitignore will be merged between the branches.
Try a combination of .gitignore and .gitattributes files:
- in
master/stablebranch, you could have.gitattributesreferring to a custom merge driver which would effectively ignore the.gitattributesand.gitignorecoming from test_unit folders. - in
develbranch, you could have.gitattributesreferring to a custom merge driver for ignoring the.gitignorecoming fromtest_unitfolders from themasterbranch, and keeping their own version of.gitattributes.
That way, you can define .gitignore in test_unit folders in the master branch: they won't impact devel branch in case of merge.
I know that you're new here—so am I—but your question would attract more answers if you formatted it. Perhaps a list showing folder structure, like this:
- List item
- List item
- List item
- List item
That would turn into:
- List item
- List item
- List item
- List item
加载中,请稍侯......
精彩评论