0

in fact there is only one person work on that repo, and there is only one branch on that repo, i use git rebase -i HEAD~200 to get rid of some meaningless commits which have "tirval commit" message in commit log, i think all these commit could be squash to previous commits, it is so natural that my current branch is not in conflict state, and all previous commits are without conflicts, even when there were conflicts, they were solved, why squash could lead to conflicts?

btw, is there quiet mode to do git rebase -i without confirming lots of popups?

Community
  • 1
  • 1
hugemeow
  • 7,777
  • 13
  • 50
  • 63
  • “without confirming lots of popups” – you may want to use `fixup` instead of `squash` then. The latter requires you to update the commit message (allowing you to combine them) while the former just discards the later message and keeps the original one. – poke May 04 '15 at 12:03

1 Answers1

1

git rebase -i do two things:

  • Rebase, i.e. rewrite your commits on top of an upstream branch.
  • Edit, i.e. do what you've asked for in the todo-list

Just a squash shouldn't introduce conflicts (except if you removed commits), but the rebase itself can introduce conflicts even if you didn't change the todo-list in the interactive part.

As @hugemeow notes in the comments, another case where conflicts can happen is if your initial history contains merges. See this question for more details: Why does git-rebase give me merge conflicts when all I'm doing is squashing commits?.

Community
  • 1
  • 1
Matthieu Moy
  • 15,151
  • 5
  • 38
  • 65
  • in fact even squash could lead to conflicts, maybe if there is merge , even one branch, one user, could lead to conflicts – hugemeow May 04 '15 at 09:52