Search code examples
gitgit-mergegit-squash

Is it safe to squash commits that include a merge commit


Can I safely squash commits where one of them is a merge commit? My commit history looks like this:

enter image description here

I'm wondering if there will be problems or conflicts when trying to merge this squashed branch into master. I haven't pushed my branch yet so it shouldn't affect other people's git history.


Solution

  • I'm wondering if there will be problems or conflicts when trying to merge this squashed branch into master.

    That question is impossible to answer from here. There will or there won't. But whether there will be "problems or conflicts when trying to merge this branch into master" has nothing to do with whether the branch is squashed or not. It depends on what's been going on in master while you were out, as it were.