![]() You have plenty of options available to you from this screen, but right now we’re just going to squash everything into one commit. ![]() Git has now put me into an editor with the above text in it, and a little explanation of what can be done. First of all, I told Git that I wanted to rebase using the last four commits from where the HEAD is with HEAD~4. # However, if you remove everything, the rebase will be aborted. # If you remove a line here THAT COMMIT WILL BE LOST. # s, squash = use commit, but meld into previous commit # e, edit = use commit, but stop for amending Pick 30e0ccb Changed the tagline in the binary, too. Pick ebfd367 Jekyll has become self-aware. Pick 6340aaa Moving license into its own file The last 4 commits would be much happier if they were wrapped up together, so let’s do just that through interactive rebasing: Our repository’s history currently looks like this: So let’s say you’ve just made a few small commits, and you want to make one larger commit out of them. ![]() Just don’t rewrite your history if it’s been shared with others. If others have based work off of the commits that you’re going to delete, plenty of conflicts can occur. We’re going to go over how you can do this easily.Ī word of caution: Only do this on commits that haven’t been pushed an external repository. What this does is take smaller commits and combine them into larger ones, which could be useful if you’re wrapping up the day’s work or if you just want to package your changes differently. The rebase command has some awesome options available in its -interactive (or -i) mode, and one of the most widely used is the ability to squash commits. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |