Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

11
  • 19
    You can actually reorder commits with mouse move? Wow, that's new to me. Either way, this can only work if those commits are independent. And in such case I suppose the order doesn't matter. Commented Oct 25, 2024 at 9:24
  • 1
    Yes, for instance, in GitHub Desktop you can do it. docs.github.com/en/desktop/managing-commits/… Commented Oct 25, 2024 at 10:25
  • 18
    A note to readers: the answer to this question is yes, if you have already pushed your branch and someone else has pulled it down for the same reason you shouldn't rebase commits you have already pushed. So the big caveat to this question is that you are working on your own private tree -- local commit history. Commented Oct 25, 2024 at 12:49
  • 11
    And for those who are not familiar with git on the command line, the screenshot in this question is doing a git rebase under the hood. Commented Oct 25, 2024 at 13:43
  • 4
    Interestingly, the next generation of VCS tools, such as DARCS and Pijul, are built around the idea that reordering is such a fundamental operation that they build their entire system around being able to do so. It's tricky in Git, due to the reasons mentioned in the answer, but the fact that GitHub does this with a mouse click points strongly towards where the future is going! Commented Oct 26, 2024 at 15:52