git-terminology-commit-push

Git Terminologies – Commit & Push

Here we will see basic commands and git terminologies overview that you need to start using git. The terms are same irrespective of which Git platforms github.com or Azure Repos , or Gitlab , bitbucket.org and various others you refer to .

View the video below to understand the clone command

Git Commit

Git Commit

Commit is an operation to save your changes to a local repository. Unlike other VCS, a commit in git do not automatically update the server repository.

As you can see, the developer has a local copy of Feature 1 branch , during the development of his feature he has done multiple changes and saved them  to the local repository as a commit. When the developer completes the feature he would then Push the code to the server.

Push is an operation where single or multiple Commits are updated to the server repository.

Commit Command Overview

Let’s look at the git command in detail. Read the article <> to install the command line tool required to try this command.

Command
git commit -m <Commit Message>

Above command will clone the ‘default’ branch from the repository.

Mandatory Parameters
ParameterDescription
-m <msg> -m followed by the message of the commit
Optional Parameters
ParameterDescription
-b or –branchProvide the name of the branch to clone
–depthpass the number of commits to clone instead of downloading
the complete history of commits. This reduces the size of your clone
Push Command Overview

Let’s look at the git command in detail. Read the article <> to install the command line tool required to try this command.

Command
git push

Above command will clone the ‘default’ branch from the repository.

Mandatory Parameters
ParameterDescription
-m <msg> -m followed by the message of the commit
Optional Parameters
ParameterDescription
-b or –branchProvide the name of the branch to clone
–depthpass the number of commits to clone instead of downloading
the complete history of commits. This reduces the size of your clone

Share your email id here, to get access to a sample repository to try out above command.

Generally, it is a good practice to do a PULL before a PUSH to avoid any loss of code or merge issues.