🚀 Harness AI to execute your million-dollar ideas 10x faster, with 1/10th the effort.Get Started

git

10/9/2022

I use git for version control.

Tips

Rename a branch...

To rename a branch, while on the current branch, run the following in the terminal (replacing newBranchName with the branch name you want the current branch to be called):

git branch -m newBranchName

Undo a commit and add more to it

Sometimes I find myself committing a small chunk of code that isn't quite right. I'll either refactor it or fix it, but I don't want to create a new "fix" commit.

When the commit was the most recent commit I made and I haven't pushed yet, I'll do a soft reset:

git reset --soft HEAD^

A soft reset removes the most recent commit and the files that were in that commit are staged. You can then add your fix and recommit with the same message.

Relevant Notes

This Article is Still in Progress

This post is a work in progress and not yet complete. If you're interested in reading the full article, let me know!

Want to Read It? Your interest helps me prioritize which articles to finish first. Click below to tell me you want to read this article when it's complete.

Chase Adams