DEV Community

Cover image for How to Push Code to Github Remote Repository
Shubham Tiwari
Shubham Tiwari

Posted on

How to Push Code to Github Remote Repository

Image descriptionHello Guys today I am going to Show you how you can push your code from your Local system to Github Remote Repository.

Lets get Started...

1. Download The Git for your system from the link below -

https://git-scm.com/download/win

2. After Download Install the git to your system

3. Then Go to the folder where your code exists

4. Then right click on your mouse and click "Git Bash Here".

Image description

5. In the terminal run the command "git init"

Image description

6. Then run the command "git add ."

It will add all the files in the directory to the commit stage

Image description

7. Then run this command ' git commit -m "First Commit" '

It will commit all the files on your loyal system.

Image description

8. Now go to github.com and create an account and then create a new repository

Image description

9. Now enter the Repository name

Image description

10. Then click create repository

Image description

11. Now copy the link in the box

Image description

12. Now go back to your folder and again right click and select "Git Bash Here".

13 Then run this command " git remote add origin YOUR_COPIED_LINK_FROM_THE_BOX"

EXAMPLE - git remote add origin git@github.com:ShubhamTiwari909/MERN-Mongo-.git

Image description

14. Finally run this command "git push origin master"

It will push the code to the master branch in your remote repository.

Image description

15. Open github.com and check the repository your files will be shown there remotely, Congratulations you can now use github to push your code from your local system to remote repository.

Image description
Image description

NOTE - In step 11 , copy the SSH link not the HTTPS.

Thats it for this post.
THANK YOU FOR READING THIS POST AND IF YOU FIND ANY MISTAKE OR WANTS TO GIVE ANY SUGGESTION , PLEASE MENTION IT IN THE COMMENT SECTION.
^^You can help me by some donation at the link below Thank youπŸ‘‡πŸ‘‡ ^^
β˜• --> https://www.buymeacoffee.com/waaduheck <--

Also check these posts as well

https://dev.to/shubhamtiwari909/media-query-with-css-grid-1l7a

https://dev.to/shubhamtiwari909/styled-componenets-react-js-15kk

https://dev.to/shubhamtiwari909/introduction-to-tailwind-best-css-framework-1gdj

Top comments (0)