How to setup Git and Github for you projects

How to setup Git and Github for you projects

Hey everyone in our today's blog we will learn how we can set up Git and GitHub so that we can collaborate with our team meet and get our work done. So let's start

Installation of git

So we will start with installing git in your local environment. So go to https://git-scm.com/downloads and download it according to your operating system.

To check whether it is installed properly or not we can use the command git --version This will show you the git version and if not then try again to install.

As you can see my git version.

Let's Create a GitHub Repo

Now that we have installed the git we will create a GitHub repo where we will store our project and share our code with the whole world. I will assume you already have a GitHub account if not then click here and go create a GitHub account.

Now go to github.com on the nav bar you will see a + icon and then click on that.

After you click that you will see these options select the New Repository

After clicking on that you will end up there where you have to enter your repo name which should be unique for your repository and then click on create repository

Now your repo has created the repo you can push your code in there.

Let's commit some file

We will first create a folder and we will execute this command one-by-one.

we will create a readme file that we will push here is the command echo "# Devops repo" >> README.md then we will use the git init command.

Now we will add the file with the command git add README.md this command will add the file in staging and after that, we will commit the file with some comments this command git commit -m "first commit of this repo"

As you can see we have committed our file now it is time to give a branch name then we will add the remote access to the repo and then finally we will push the commit.

Yes, we push our changes. You can see your change by going to the repo

The End

That's all for today. We learn a lot see you in my next blog.

Did you find this article valuable?

Support Sourav Kumar by becoming a sponsor. Any amount is appreciated!