Git: How do I rebase Branch Feature back onto Branch Develop minus Branch MyLocalChanges

牧云@^-^@ 提交于 2019-12-23 01:05:46

问题


We have a develop branch and many feature branches that are created from develop as needed and will eventually be merged back into develop.

When I work, I have a set of local changes I like to make, these are changes to settings, changes to scripts, changes to modules, etc. that change various flags, or change log messages, or do this or that differently from how much of the team works.

I'd like to keep those changes in a branch based on develop called MyLocalChanges which would be developed and merged (?) into what feature branch I am working on, but which never be merged back into develop

And then in the end, when everything has been tested, I'd like to either create a pull request or do a rebase of (Feature - MyLocalChanges) onto Develop and I'd like to do that from the command line, without using rebase -i

Perhaps it might be expressed like this:

git merge (feature - (diff mylocalchanges develop)) develop

How do I do this in git? What is this sort of subtractive merge or rebase called?


回答1:


Since it is not trivial to merge a commit "minus some changes", it is best to:

  • only version template files, filled with default values valid the team
  • have private files with your own value
  • version a script able to generate the actual config files, with the right values: those generated files would also be private (that way, no issue when merging)

See an example of such a content filter driver here.



来源:https://stackoverflow.com/questions/54450468/git-how-do-i-rebase-branch-feature-back-onto-branch-develop-minus-branch-myloca

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!