How can you control git commands with examples?

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Hello techies, welcome to the real world of programming. Today, we are going to talk about the Git command line. Whether you will read this article fully so, I’ll do promise that you will get all control over the git commands until the end. It means as many commands, after this article, you will learn yourself through the command line, you can use full git. It is the best way because if you use GUI directly on any website, GUI comes in understand that all right but doing directly upload, this is not a right way, it is a practical process. What you will do, when the file will be large. This thing we are going to do through git command line that very command comes in the hands of the programmer. If we use a command line. So, let’s start with the elaborative part of this article. This article till the last, if you will have fear regarding command line becomes black from behind so, all your fear will vanishes.

How to install git on windows 10?  

So, let’s look. What you will do first? First, you will do a search on the web like git for windows download through enter click. You will get all downloads over there. As you will open by clicking the first option then it will directly reach you in windows. And there, your download will be started, what so if you will do manually then download will be started. One of the websites like git scm.com, from this you will download that git. So, this is not big stuff to install this, the normal default setting is there next-next as you install. Likely, you will install it. When the git will be downloaded then you will click on it, they will ask for permission. After doing the default setting, next-next, you will install that. When the installation will have done so, you will make a new folder from the name all about git. Under that folder, you will use git. If you want to check git is installed or not then you will do one right-click and you will see two options there like git bash here, and git GUI here. These two commands will come if you will do one right-click. You have a folder from the name all about GIT, if you want to do all work in that folder so, you will use the GIT bash here option according to the git command line, instead of GIT GUI here.

GIT command line tutorial

You will open the GIT bash here. There will open with the dialog box, you will do resize with maximize option. What will you do next, firstly, if you would install GIT on your desktop? So, what types of things, you will have to do. That is not so important to do but you have to do so, your name, who are making and uploading on GitHub, all this information comes from there. Now, let’s do configurations of these, first, we shall write like this 

            $ git config ¥- global user.name Mohan and as you will press the enter key then configuration key name will come like this,

          Mohan@LAPTOP- CR327854 MINGw64  ~/Desktop/All about git (master)

Usually, we will do a configuration of email,

            $ git config – -global user.email beaproplayer24@gamil.com and it will save like this,

Mohan@LAPTOP- CR327854 MINGw64  ~/Desktop/All about git (master). At the apex, there will be written like a master, you will understand about all this thing in upcoming part. How can you make a branch of your own and do a clone of it? Now, you have to check that your configuration has done or not so, you will right like this way, 

            $ git config – -global user.name Mohan, only you will write much like then your name will be print like this way,

            Mohan@LAPTOP- CR327854 MINGw64  ~/Desktop/All about git (master)

Git configurations

Now, the Configuration has been done. All that command, you were doing in previous then only you will put some key so, all of your commands will be done. If you put $ code . So, this is a shortcut to open your vs code through the terminal. So, your next query will be what is terminal? It is the terminal of UNIX that you are using in your windows. That terminal in mac which has UNIX- based, that GIT, is also a Unix-based terminal, you can also use it as a terminal. When you put $ code .  In that the vs code will open so, every file you will make in that. Those you want to upload in GitHub so, let’s have a look at how you can do that. If the new file you have to make, whenever you use GIT then what command do you move in first.

Initializing GIT repository

Whenever you make a repository, what command do you make first? A repository is a folder in that your projects may exist, whenever you move GIT. So, to the name of $ git init, you have to move that. When you do GIT init then there will come in written like initialized empty GIT repository in C: /users/Mohan/Desktop/All about GIT/.git/ it means to the name.GIT folder has come in file explorer but you will not see then after doing click on hidden items then to the name.GIT folder will have arrived there but you will not tease them and will hide them again. So that, you will again go to the command line and you want to see in the command line what type of folder is hidden there. So, there will be commands like $ ls – lart, all your hidden files will show you. This is the command, you can easily get it. There is a command, you will always use in GIT for knowing status such as $ git status then it will show information like branch master, commit yet, and untracked files. These all happen as untracked, modified, unmodified, and staged areas, firstly you, let’s understand about this. You have made a command line, installed and you are using it.