Essential Git Commands: A Developer’s Guide to Command-Line Mastery

Buyung Hardiansyah
2 min readJan 23, 2022

--

In this post, I will summarize some of the git command that are often used for software development. Although there are many ways to use git (by using the GUI). If you know how to run the command-line version, you can probably also figure out how to run the GUI version.

Git Remote

Git remote is a command to manage repositories.

Git Branch

Git branch is a snapshot from changes you have made. When adding new features or fixing bugs you spawn a new branch in the origin repo to encapsulate the changes. This is so that unfixed or unstable code does not need to be merged into the main code base.

Git Merge

Git merge is a command to combine branch from one to another into one unified history.

Git Rebase

Git rebase is a command to reapply commits from different branch on top of existing commits in the active branch.

Git Reflog

Git reflog is a comand that displays all log records when a branch updates the local repository. Reflog serves to determine the old reference value. Reflog also functions to find the last commit that was overwritten.

Git Stash

Git stash temporarily save changes you've made to your working copy so you can work on something else, and then come back and re-apply them later on.

Git Add

Add changes in the working directory with git add.

Git Commit

Git commit captures a snapshot of currently staged changes.

Git Commit Amend

Git commit amend is to reapply changes to the latest commit. This command will open up the system’s configured text editor and prompt to change the previously specified commit message.

Git Reset

Git reset is a command to reset changes to a certain state.
For example, when a change has been staged but has not been commit, it will return to an unmodified state.
Git reset can be used to revert changes that already commit to unmodified changes.

Git Revert

Git revert is a git command to undo or reverse changes in a single commit.

Git Cherry-pick

Git cherry-pick is a tool for applying a commit from another branch to the currently active branch.

Git Tag

Git Tag is a command to capture specific commit in the log history as important commit. Tagging is generally used to capture a point in history that is used for a marked version release

Summary

There are still some other git commands which can be seen in the git documentation. but usually the above command is often used for software development.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Buyung Hardiansyah
Buyung Hardiansyah

Written by Buyung Hardiansyah

Software Developer -- Golang | Python | PHP | Reactjs | Flutter

No responses yet

Write a response