'Merge only specififc files when merging branches in GitHub [duplicate]
I have a repository on GitHub where I have two branches, main and production. production is my development environment and main my release environment. But I have a CHANGELOG.md file in production that I don't want in main because I want there a changelog file unique for main.
Is there a way that I can merge my procuction branch with my main branch without merging CHANGELOG.md?
Solution 1:[1]
Git won't allow you to merge one branch into another if there are conflicts in files. When merging, you have to decide on your own what version of file you are going to save in main. If you want to keep main's changelog, you should keep the version stored in main by opening this file after merging and removing the corresponding error markers. The changelog on production branch will not be affected.
UPD As it was mentioned in the comments, it doesn't happen all the time that you have conflicts. The solution may really be to have a different file for each branch.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
