Member-only story

Six Lesser-Known Git Commands to Make Your Life Easier

I wish I had known them sooner.

Logan Rane
2 min readJan 30, 2022
Git Logo

I was going through some random content on google and stumbled upon some git commands which can make your life easier.

I have spent hours doing some of the tasks manually mentioned below.

So, let’s get on with it.

Updating Your Last Commit Message

We all have experienced noticing a typo message in our commit just after hitting the enter button.

It is often frustrating and makes you look unprofessional.

git commit --amend -m 'Updated message'

Using the command, you can edit your last commit message easily.

Blank Commit

I have found cases where I want to commit, but no files are added, changed, or deleted. In this case, I had to make some changes to commit anything.

But, it is not the case anymore.

git commit -allow-empty -m "No changes made"

Using this command, you can commit without any changes. It may be helpful when you need to trigger a build step or start a new branch.

Staging and Committing in a Single Command

--

--

Logan Rane
Logan Rane

Written by Logan Rane

Top Writer @Medium | Creatorprenuer | Learn How To Create | Build an Internet Business Solo | Join Medium - https://bit.ly/3LypdOK

Responses (2)