File tree 1 file changed +15
-0
lines changed 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -672,6 +672,9 @@ Now you can commit your changes in your local repository::
672
672
673
673
git commit -m
674
674
675
+ Combining commits
676
+ -----------------
677
+
675
678
If you have multiple commits, it is common to want to combine them into one commit, often
676
679
referred to as "squashing" or "rebasing". This is a common request by package maintainers
677
680
when submitting a Pull Request as it maintains a more compact commit history. To rebase your commits::
@@ -681,6 +684,18 @@ when submitting a Pull Request as it maintains a more compact commit history. T
681
684
Where # is the number of commits you want to combine. Then you can pick the relevant
682
685
commit message and discard others.
683
686
687
+ To squash to the master branch do::
688
+
689
+ git rebase -i master
690
+
691
+ Use the ``s `` option on a commit to ``squash ``, meaning to keep the commit messages,
692
+ or ``f `` to ``fixup ``, meaning to merge the commit messages.
693
+
694
+ Then you will need to push the branch (see below) forcefully to replace the current commits with the new ones::
695
+
696
+ git push origin shiny-new-feature -f
697
+
698
+
684
699
Pushing your changes
685
700
--------------------
686
701
You can’t perform that action at this time.
0 commit comments