/    /  Git – Terminology

Git Terminology

 

Git is a tool that contains a lot of terminology and jargon, which can be confusing to new users. Let’s explain the terminology behind the tools. Let’s take a look at some common terms.

Some commonly used terms are:

Branch

It’s a version of the repository that diverges from the main working project. Most modern version control systems include this feature. There can be more than one branch in a Git project. Many operations can be performed on Git branches, such as renaming, listing, and deleting.

Checkout 

In Git, checkout means switching between different versions of an entity. Git checkout switches between branches in a repository.

Cherry-picking

Cherry-picking in Git means applying a commit from one branch to another. You didn’t want to merge the whole branch because you made a mistake and committed a change to the wrong branch. You can revert the commit and cherry-pick it from another branch.

Clone

Git clone is a command-line tool. It copies or clones the target repository. From the URL of the repository, I can create a local copy of my GitHub repository on my local drive.

Fetch

It retrieves branches and tags from multiple repositories, along with the objects needed to complete their histories. Remote-tracking branches are updated.

Head

The HEAD represents the last commit in the current checkout branch. The head can be compared to the current branch. The HEAD revision changes when you switch branches with git checkout.

Index

Git indexes are staging areas between working directories and repositories. It’s used to build up a set of changes you want to commit.

Master

Git branches are named Master. It’s the default branch in Git. After cloning a project from a remote server, the local repository only contains one branch. It’s called the “master” branch. The “master” branch is the “default” branch for a repository.

Merge

Merging is putting a forked history back together. Git merge lets you combine the data from git branches into one.

Origin

In Git, “origin” refers to the remote repository from which a project was cloned. It’s used instead of that original repository URL to make referencing easier.

Pull/pull request

When you pull data from GitHub, it’s called a pull. Changes on the remote server are fetched and merged into your working directory. The git pull command is used to make a Git pull.

As soon as a developer’s feature branch is ready, he or she files a pull request via their remote server account to notify them that changes on the remote server have been fetched and merged. All the team members know that they have to review the code and merge it into the master branch when they send a pull request.

Push

Whenever a developer’s feature branch is ready, he or she files a pull request through their remote server account to let them know that the changes have been fetched and merged. Pull requests have to be reviewed and merged into the master branch by all team members

Rebase

Rebases are used in Git to move or combine a series of commits into a new base commit. In the environment of a feature branching workflow, rebasing is very helpful.

From a content perspective, rebasing is changing the branch’s base between commits.

Remote

Remote refers to a remote repository in Git. All team members use it to exchange changes. Remote repositories are hosted on code hosting services like GitHub, Subversion, and internal servers.

Remote repositories typically don’t provide a file tree of the project’s current state, instead they just provide .git versioning data.

Repository

Repository is like a VCS data structure that stores metadata for files and directories. It stores the collection of files and the history of changes. Git repositories are your project folders. All the project data is in a repository. There are different repositories for different projects.

Stashing

There are times when you want to switch branches, but you are working on an incomplete part of your current project. It’s not a good idea to commit half-done work. Git stashing lets you do that. If you don’t want to commit the current branch, you can use the git stash command.

Tag

The tags mark a specific point in Git history. It marks a commit stage as important. We can tag a commit for later reference. It’s used to mark a project’s start, like v1.1. Tags come in two types.

Light-weighted tag

Annotated tag

Upstream and Downstream

Upstream and downstream refer to the repository. A repository’s upstream is where you cloned it from (the origin) and its downstream is anywhere else Bringing your work together with other people’s. However, these terms don’t just apply to Git repos.

Git Revert

The term revert is used in Git to refer to the process of reverting a commit. git revert is used to revert a commit. It’s an undo command. It’s not a traditional undo.

Git Reset

Reset means undoing changes in Git. Git resets the changes. It has three main forms of invocation. They are as follows.

Soft

Mixed

Hard

Git Ignore

Git ignores files that are intentionally untracked. Git does not affect files that are already tracked.

Git Diff

This is a Git command-line tool that runs a diff function on Git data sources. These data sources can be files, branches, commits, and more. It shows changes between commits, commits, and working trees.

Git Cheat sheet

This cheat sheet is designed to summarize Git quick references, with quick installation instructions. It is a brief set of notes used for quick reference. Cheat sheets are named as such because people may use them without prior knowledge.

Git Flow

It is a branching model for Git, developed by Vincent Driessen. Gitflow is a collection of Git commands that perform many repository operations with just one command.

Git Squash

You can merge several commits into a single commit with the powerful interactive rebase command in Git. Git squash is an excellent way to group-specific changes before forwarding them to others.

Git Rm

Git’s rm command is used to remove individual files or collections of files. It removes tracked files from the Git index, and can also remove files from the working directory and staging directory.

Git Fork

When you fork a repository, you can test and debug changes without affecting the original.

To fix a bug you found, you can use forks to propose changes.To fix a bug you found, you can use forks to propose changes.

Fork the repository.

Make the fix.

Forward a pull request to the project owner.