DEV Community

Rohan Kaicker
Rohan Kaicker

Posted on

Understanding "git rebase" and "git commit amend"

This week in OSD600, we learned about how to clean up our git history.

We were first tasked with making a few improvement to our code base.

I chose to improve my program by:

  1. Separate text file handling
  2. Separte markdown file handling
  3. Utilizing fs.rmSync() for deleting the /dist folder instead of my previous method (using readderSync to find contents of /dist folder, and then calling unlinkSync).

Using git rebase to "squash" all my commits into a single commit was definitely interesting. I didn't know this was a possibility, and in one of my Hacktoberfest PRs I actually have 10 commits for one feature upgrade - I plan on using git rebase to "squash" this down to 1 commit for cleanliness.

Then using git commit ammend to modify the commit message was also a neat feature, and the ability to quickly add something to the previous commit (as I have multiple times found things I've missed right when I've commited something).

These two are definitely features that I'll be using more often in the feature!

Top comments (0)