DEV Community

Advance Git commands

Version control, also known as source control, is the practice of tracking and managing changes to software code, it helps software teams manage changes to source code over time.

VC sometimes known as SCM (Source code management) tools or RCS (Revision Control System) and one of the most popular VCS tools in use today is called GIT.

Git is a distributed version control system, a category known as DVCS that tracks changes in any set of computer files, usually used for coordinating work among programmers collaboratively developing source code during software, Git once had a reputation for a steep learning curve. However the Git maintainers have been steadily releasing new improvements like sensible defaults and contextual help massages that have made the onboarding process a lot more pleasant.

Advanced Git commands are listed and explained below

GIT rebase command is similar to the git command, it combines a sequence of commits to a new base commit. Rebasing is most useful and easily visualised in the context of a feature branching workflow, you can rebase whenever you want to add changes of a base branch back to a branched out branch. You should use the Git rebase command when you have multiple private branches to consolidate into a single branch.

Usage
$ git rebase

The git revert command can be considered an 'undo' type command, however, it is not a traditional undo operation. Instead of removing the commit from the project history, it figures out how to invert the changes introduced by the commit and appends a new commit with the resulting inverse content. This prevents Git from losing history, which is important for the integrity of your revision history and for reliable collaboration. Reverting should be used when you want to apply the inverse of a commit from your project history. This can be useful, for example, if you’re tracking down a bug and find that it was introduced by a single commit. Instead of manually going in, fixing it, and committing a new snapshot, you can use git revert to automatically do all of this for you.

git cherry-pick is a powerful command that enables arbitrary Git commits to be picked by reference and appended to the current working HEAD. Cherry picking is the act of picking a commit from a branch and applying it to another. git cherry-pick can be useful for undoing changes. It doesn't modify the history of a respiratory insteads it adds to the history.

Usage
$ git cherry-pick

Top comments (0)