分支间合并时,如何跳过git合并某个文件



如何在分支间合并时跳过git合并某个文件

src/main/resources/application.properties in development branch contains ENV for dev
src/main/resources/application.properties in staging branch contains ENV for staging

git checkout staginggit merge origin/development -覆盖上面的文件,我不想这样做。我该如何预防呢

  1. git merge --no-commit
  2. 编辑/恢复到你想要的文件
  3. git add src/main/resources/application.properties
  4. git commit