How to add our project on github from windows machines

Create your github account at github.com


Download the git in your computer/laptop from here and install in your machine




First of all you have to open your project folder in my case e-com is my project folder


Open your project folder as given below



Right click and open git bash


Type git init command


Notice in your folders there will be a .git folder will be created. now next command is git add . (type command carefully you have to type dot also)


Now, next command is git commit -m "first commit"


Now, check the branch by this command git branch branch can be master or main in my case it is master.


Go to github and Sign in and create new repository by clicking on new or it can be plus + sign. I clicked on new


It opens like this


Now, give the repository name, add description, make it public or private it is up to you and click on create repository button.


Above page will be open now type this command ssh-keygen -t ed25519 -C "your_email@example.com" you have to click on enter button only and Overwrite (y/n)? y
 


Now run this command eval "$(ssh-agent -s)"


Now run this command ssh-add ~/.ssh/id_ed25519



Now for copy the ssh key run this command clip < ~/.ssh/id_ed25519.pub


Now, go to github and open your created repository


Now, go to settings then open deploy keys


Now, click on add deploy keys button, give any titile, and paste the deploy key in the key box and allow write access. Click on add key button.


Now click on code


Copy this selected command from your github and paste it in your git bash (Note: you have to copy your command only do not copy my command)


Like this



Check branch



Now run this command git push -u origin master my branch is master thats why i typed master if your branch is main then you have to type main.


Congratulations guys your project successfully added to your github now you can check your github repository you will find files there like this





Comments