Setting up a local git repository

Hi, I am data engineer from Nepal with over 3 years of professional experience and love working with ASP.NET, SQL Server and Raspberry Pis.
Search for a command to run...

Hi, I am data engineer from Nepal with over 3 years of professional experience and love working with ASP.NET, SQL Server and Raspberry Pis.
No comments yet. Be the first to comment.
In this series, we will explore git through commands and learn about commands that every developer should be aware about.
Once we have set up our Git and the repository, we can get started with the version control. We can now work on files and directories in the repository, make changes, and commit those changes. Concepts of Staging When we create or edit an existing fi...
In the previous article, we staged the changes we made to the files. Now, we will be committing our code to make the changes permanent and make additional changes on top of them. Committing changes Once we have staged our changes, we can now use git ...

Once we have set up our Git and the repository, we can get started with the version control. We can now work on files and directories in the repository, make changes, and commit those changes. Concepts of Staging When we create or edit an existing fi...

In this article, we will be looking at how you can install git on your system. After installing git on the system, we can use it to version control the directories. Installing git on a Linux Installing git on a Linux is pretty straightforward. In the...

Git is one of the most popular version controlling system out there. It is a free and open source version controlling system. Git has become an integral part of software development. Git is a distributed version controlling system meaning multiple developers can work on their own feature or even better, multiple developers can work on a single feature.
Most of us when working with git tend to associate git with Github, Bitbucket and other services. When in reality, git, due to its distributive nature, can be used to version control anything locally and does not require any online services to function. You can use git once you have installed the Git on your computer. Online services such as Github are merely providing platform for collaborating on a project.
In this article, we will be diving into git concepts and commands which will increase your confidence in git.
We need to initate a directory as a git repository. Once it is completed, we will be ready to perform version controlling inside the directory. First, we will create a folder named learning-git and initialize it as a local git repository.
$ mkdir learning-git
After the directory is created, we will change the directory to learning-git and run git init command which will initiate our repository.
$ cd learning-git
$ git init
Initialized empty Git repository in /home/pidalu/learning-git/.git/
We will also run ls -A command to view all the directories in the directory including the hidden ones.
$ ls -A
.git
We can see that a .git directory was created inside the directory. Git uses this directory to store and track changes. Getting rid of this directory means that git will not be able to track changes in the directory.
We have now successfully created our local git repository. We can create any files or directories inside this directory and git will be able to track those changes. In our next blog, we will dive into how we can track those changes.