O
O
Odisseya2018-06-02 18:17:58
git
Odisseya, 2018-06-02 18:17:58

How to exclude individual files for branches when merging?

Greetings. Different branches have config files of the same name , which are under version control and are maintained unchanged when branches are merged using .gitattributes. Task: it is necessary that for some branches there are no config files , i.e. despite the presence of such a file in the donor branch, when merging, the config file should not appear.
Clearly:

  • Donor branch: has a config file
  • Acceptor branch: does not have a config file
  • Desired merge result: branch has no config file

Now this is implemented by creating an empty (garbage) config file in the acceptor branch. This is to cause a conflict which will trigger the merge driver and the rule from .gitattributes. But in fact, these empty config files are not needed in the project, is it possible to get rid of them somehow? Is there a way to leave a file under version control, but ignore its presence when merging?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question