In general, I would recommend trying and getting away from this configuration fixing situation. Can you save the configuration during deployment? Or use lubrication filters, as I explained here: fooobar.com/questions/1454076 / ...
If this is not an option, let me answer your questions, as there are easier ways to achieve what you want, thanks to the fact that branches in git are so easy. None of them are fully automated, but quite simple, and you can definitely write small scripts for it.
each new commit is automatically applied โbelowโ the top commit
Not quite sure about the situation, but assuming you made changes and want to commit them:
- Remember that your current SHA branches
- Click your changes
git reset --hard HEAD^stash pop- commit
- cherry-select your branch-branch
each merge or cherry pick is also automatically applied โbelowโ the top fix
same as above: reset --hard , do your job, old cherry branch
merging from such a branch is pulled out of the state "below" the upper commit?
It is very simple: git merge mybranch^
If you do not want to change your working directory, and files changed by your "config" are not affected by your other operations, you can do this:
- Remember that your current SHA branches
- Do a soft reset:
git reset HEAD^ - Make git ignore your config files via
git update-index --assume-unchanged - create commit
- run
git update-index --no-assume-unchanged for your config files - commit again - this will re-create your configuration files.
If you automate this with a script, you can use git to get a list of configuration files for --assume-unchanged by looking at the configuration commit. If you do not want to automate this, you can skip steps 3 and 5 and just make sure that you do not execute your configuration files in step 4.
source share