annafit.blogg.se

Sourcetree squash 2 branch
Sourcetree squash 2 branch








sourcetree squash 2 branch sourcetree squash 2 branch

Now, we need to choose a message for the new combined commit. We can use the squash command in the second line to combine ffb98dd and 2702f8b into a single commit: pick ffb98dd Initial commit # Rebase fe2c946 onto 6fafbe0 (3 commands) Now, the output includes the root commit ffb98dd in the first line: pick ffb98dd Initial commit This allows us to rewrite the Git history down to the root commit. We can now specify the -root flag for the rebase command to rebase all reachable commits up to the root: $ git rebase -i -root The solution for this problem was introduced in Git 1.17.12. So how do you squash the second commit into the root commit if the root commit isn't listed? # Rebase ffb98dd.fe2c946 onto ffb98dd (2 commands)Īs you can see, the second commmit 2702f8b and the third commit fe2c946 were listed, but the initial commit ffb98dd wasn't. When I ran git rebase -i ffb98dd, this was the output I got (omitted for brevity): pick 2702f8b Small tweaks Here's what my Git history looked like: $ git log -graph -oneline As usual, I ran the git rebase -i command to do an interactive rebase, but I noticed that the root commit didn't appear in the list of commits. I recently needed to squash the first two commits in one of my Git repositories.

#Sourcetree squash 2 branch how to#

How to Squash the First Two Commits in a Git Repository November 1, 2020










Sourcetree squash 2 branch