In the first part of my writing, where I will address topics such as What is Git and Github, what they are used for, and how to use them—indispensable tools for developers—I want to explain Git in the first part and Github in the second part. To correctly understand Github, let's start with Git first.
Before starting, if you understand the basics of what Git is and how it works, using Git effectively will likely be much easier for you.
Git, is a version control system used in software development processes. Git allows you to take step-by-step copies of the versions of your projects, so you can easily revert to any of these copies, or versions, whenever needed. The first version was designed and developed by Linus Torvalds in 2005 for the development of the Linux kernel, and as of 2019, it has reached a 70% market share. Git is an open-source and free software product that you can use as you wish.
Why Do We Need Git?
Git Why we need to use Git, I want to explain with a short example. gitProject1.cs, let's assume that we have a project named gitProject1.cs and we want to make a change or add a new feature to this project. Instead of directly modifying gitProject1.cs, gitProject1-Copy.cs, which is a duplicate of gitProject1.cs. By doing this, if we encounter an error, we can revert to the original project gitProject1.cs, which is the first version. This is exactly what Git allows us to do easily. This way, we protect our project against risks. By repeatedly applying these operations, we can complete our project development process in this manner.
How to Install Git?
Let's install Git together according to the Windows operating system.
-
First, we download Git from git-scm.com/downloads to install it on my computer.

-
We run the Git installation file we downloaded. After clicking Next to accept the terms and conditions in the first window, it typically shows where to install Git. You can leave it as is or change it if you wish. After skipping that step, the "Select Components" section will appear. You can also leave it as default and click Next to continue.

-
After this step, you can directly skip the "Select Start Menu Folder" step as well.
-
In the next step, you need to select your default editor. Since I use Visual Studio Code by default, I chose the "Use Visual Studio Code as Git's default editor" option.

-
After selecting the text editor we want to use by default, a screen like the one below will appear, where we need to choose how we want to use Git. I choose the recommended option "Git from the command line and also from 3rd-party software". This option allows us to use the "Git Bash" program as well as the "CMD" (command prompt) window to use Git commands. For this, the Git directory needs to be added to the system's environment variables.

-
At this stage, we need to select the line ending style. Since the style may vary depending on the operating system, we are asked to make a selection. The default option "Checkout Windows-style, commit Unix-style line endings" works for the "Windows10" operating system.

-
Now, we specify the terminal that Git Bash will use. You can choose to use the MinTTY terminal or the classic "Command Prompt".

-
The option here can remain as Default.

-
Finally, there are additional settings related to Git usage. Here, you can leave it as default, which is the recommended settings, without making any changes. Click Next to complete the installation.

-
If you have successfully completed the above steps, it means you have installed Git on your computer.
Let's Test the Git Installation
If you want to see whether you have successfully installed Git on your computer, you can test it. I will show you how to do this.
-
Start > Search > Git Bash > Run

-
On the opened screen, we type " git version " as shown in the image above.

-
If it displays the version as it does on my end, you have successfully completed the installation and there are no issues.
Basic Git Commands
- "git config" Command:
With this command, you can link the Git terminal on your computer to your own Github account.
git config –global user.name “your_username”
git config –global user.email “your_email_address”
After entering the two commands above into the terminal, every operation you perform in the terminal will also be applied to your Github account.
- "git init" Command:
The git init command is used to initialize a folder you have created on your computer as a Git repository. In other words, it turns a folder you created on your desktop into a local repository.
- "git clone" Command:
You can use the "git clone" command to copy a repository from Github to your computer.
- "git add" Command:
It adds the changes you have made in your project to the working directory (repository). In short, it prepares them to be committed.
- "git push" Command:
It sends the project you have created to the repository on Github.
- "git pull" Command:
It pulls the changes you have made in the main project file to the version on your computer.
- "git commit" Command:
If you want to record all the changes you have added with the "git add" command, you can use the "git commit" command. The following command helps you save the changes made to your file.
git commit -m "Description"
- "git status" Command:
"git status" command briefly provides information about the repository.
- "git branch" Command:
By using this command, you can see all the branches.
- "git merge" Command:
It performs the operation of merging two segments that you have been working on.
We have completed the first part of my writing series where I explained Git and Github here. In my second article, I will be explaining Github. For a detailed guide and more about Git and Github, you can follow the Coderspace Blog.