Ignore the folder in a stable, but not in the branch

I have the following folder structure for my project

src/
   test_unit/
   package1/
      test_unit/
   package2/
      test_unit
output/

In my devel branch, all folders should be versioned, but the master / stable branch should ignore and not combine test_unit / and output / folder.

How can i achieve this? With .gitignore, it will not work because .gitignore will be merged between branches.

+3
source share
2 answers

Try a combination of files .gitignoreand .gitattributes:

  • in the branch master/stable, you can have .gitattributes, referring to a custom merge driver that effectively ignores .gitattributesand .gitignorecoming from the test_unit folders.
  • devel, .gitattributes, .gitignore, test_unit master, .gitattributes.

, .gitignore test_unit master: devel .

+1

, , , , . , , , :

 - List item
 - List item
  - List item
 - List item

:

-1

Source: https://habr.com/ru/post/1726042/


All Articles