How to prevent commits from a feature branch from showing up in the dev branch after the pull request is merged?
09:00 28 Jan 2022

What I have done

In local repo:

  1. git checkout -b feature/db/projectImport dev
  2. make changes
  3. git add . and git commit
  4. git push origin feature/db/projectImport (staying in that branch)

Now in GitHub:
5. Click the Compare & pull request button and finally merge with the default merge button, which claim to use --no-ff



Pull request Image pull request


What I want to achieve

  • I don't want the commits messages from the feature branch to appear in the commit messages in the dev branch.
  • When I merge the feature branch into dev, the feature branch will retain all its commits but the dev branch will only have the merge commit. Is this possible???

Related Images from the repo

Feature branch commits: feature branch commits

Dev branch commits: dev branch commits

Note:

  • I am newbie in git. So, my thinking can be wrong. If this is the case, please point out my mistake and tell what is correct.
  • Any suggestion gratefully received. Thanks in advance.
git github