关于 git 合并的三种情况处理方法

两个branch:dev、master

现在 master merge dev 同时希望

  1. 排除合并 dev 的某次提交
  2. 排除合并 dev 的某次提交的某个文件
  3. 排除合并 dev 的某次提交的某个文件的某段代码

以上三种情况怎么操作?或者脚本怎么写?

https://stackoverflow.com/questions/66433827/how-to-skip-git-merging-a-certain-file-when-merging-between-branches

  1. git merge --no-commit
  2. edit/revert the file to what you want it to be
  3. git add src/main/resources/application.properties
  4. git commit