DEV Community

Amazing
Amazing

Posted on

Week 6: Refactoring and git rebase

This week I will is about refactoring my code and you guys can check out my change at this commit 6f20f71

**Summary of what I did

I change my README.md,package.json, LICENSE to close 2 issues #3 and #4

I did move the parsing comman line argument into src/argv.ts and parsing html into src/html-maker.ts and instead of a global variable let inputPath; I decide to wrap all of them in another function for best practice

And thanks to the advises on Slack from my prof, I decide to change using camel case which is my favourite to kebab-case.js
**Git rebase

I think this week we leanr another best practice using git where we can avoid octopus node using $ git rebase <the branch that we rebase our branch>. I remmeber when I first start Git, people keep talking about Git as a time machine and now I know why. Rebase will move your HEAD one commite above and when you merge it back to the main branch, you will have a nice and clean commit log.

$ git commit --amend also super usefull. I did not remeber how many times I have to create dummy commit because I forgot to change one or 2 small things in my working tree and have to start another new commit. Amend the commit really come out and help my git log way cleaner

Discussion (0)