Lesser used GIT commands to use more often.

Pronomita Dey
The Tech Matter
Published in
2 min readDec 6, 2022

--

GIT is so powerful. While most of you might already be exploiting this cli element to much of it’s power, most aren’t.

Here are some less well-known but still useful git commands that you may find helpful and really really handy.

  • git blame: This command is used to view the changes made to a particular file and the specific commits that introduced those changes. This can be useful for identifying when a particular line of code was added or modified.
  • git bisect: This command is used to find the specific commit that introduced a bug in the code. This is done by performing a binary search through the commit history to identify the commit that caused the bug.
  • git stash: This command is used to temporarily save changes that you have made to your working copy but are not ready to commit. This allows you to switch to a different branch or perform other operations without losing your changes.
  • git tag: This command is used to create and manage tags in a Git repository. A tag is a named reference to a specific commit, and it can be used to mark a particular version of the code.
  • git reflog: This command is used to view the local reference log, which tracks the history of all local branch references and their updates. This can be useful for recovering lost commits or undoing operations.
  • git gc: This command is used to clean up unnecessary files and optimize the local repository. This can help reduce the size of the repository and improve performance.
  • git worktree is a command in Git that allows you to create additional working trees for a local Git repository. Working trees are directories where you can check out and work on branches from the repository. By default, a Git repository only has one working tree, but with git worktree, you can create additional working trees for the same repository.

These are just a few examples of less well-known git commands that you may find useful. Again, I recommend consulting the Git documentation or other resources for more information on using git effectively.

Go ahead, give it a try and I am sure you ain’t turning back. Happy forking!

--

--