Mark As Completed Discussion

Advanced commands

Despite the previously mentioned commands, there are plenty of other commands that can do wonders if you learn how to use them. We will cover some of the most useful and interesting ones.

To clean the repository from the untracked files (the ones not added with the git add command):

SNIPPET
1$ git clean

The command git bisect can help you find the error in some previous commit. It walks you through the past commits until you find the broken one!

SNIPPET
1$ git bisect

And another usage of the git commit command can be $ git commit --amend , which is a convenient way to modify the most recent commit. It lets you combine staged changes with the previous commit instead of creating an entirely new commit.

However, when in doubt, you can always use $ git command --help to see the usage of some commands!

Lastly, these commands can significantly improve your productivity and the perfromance in your work, you do not have to remember them all, but remembering the most important ones can save you some time!