How to push projects on Github?

For Beginners

To push the projects on Github ,we will discuss it step by step .First of all you should have signed up on Github ( https://github.com ,most important thing to do ,haha...) .After signing up navigate to the home page of your profile .First we will set up the things on Github profile then we will move on the command line in our local system.

So let's start with it ,

git blog2.png

Step 1 : Click on green button New and then provide it a repository name ,then provide a description if you want . Then if you want that your repository should be accessible by everyone ,then choose public oherwise choose private . Then at last there are more options like adding a README ,add gitignore and choose a license .For now skip all these options and just click on Create Repository. git blog.png

Step 2 : Now you will see below screen , Now click on Code and copy the HTTPS link (Be patient we will use it soon). git blog 3.png

Step 3 : Now install Git CLI from this link https://git-scm.com/downloads

Step 4 :After installing the Git please open you project folder and open terminal in the root directory of project (windows : Shift+Right-mouse-click) .After opeing the terminal just run (to check whether git is correctly working or not) .If not working please install Git CLI again .

git --version

If everything works fine till here then initialize a Git folder in local by running below command .

git init

After executing you must see a .git folder in your root directory of project .

Now we will use the same HTTPS link that we copied from github

git remote add origin HttpsLinkHere

Now run below command .(To track all files in git we use full stop after git add )

git add .

Then , In double quotes you should provide a message that you want

git commit -m "Initial commit"

At last

git push -u  origin main

Now if this command is executed ,now you can visit Github and see that your project directory is pushed to the repository that we created .

#techagog I hope the article above helps you . For now, let’s end it here. Please subscribe to my Youtue channel : Youtube