Pushing folders from local pc to GitHub using Git

Hello all,
In this post, I will be explaining the procedure to push our local projects, files etc to a GitHub repository in simple and elegant way!
First of all make sure to install Git in your computer and link your email and other things to it!

Now,…


This content originally appeared on DEV Community and was authored by AMAR SINGH

Hello all,
In this post, I will be explaining the procedure to push our local projects, files etc to a GitHub repository in simple and elegant way!
First of all make sure to install Git in your computer and link your email and other things to it!

Now, head toward that folder which you want to push there on GitHub.
Then, Follow following steps-

  1. Open Git Bash in that particular folder.
  2. Type git init (this will make that folder a repository)
  3. Type git add . (this will add all files to the repository)
  4. Type git commit -m "Intial commit msg" (all files now in repository)
  5. Type git status (you will get a msg "Working tree clean")

These are the steps which are used to make a local repository, now to push the same to a GitHub repository we use following steps-

  1. Open your GitHub profile and create a New Repository.
  2. Copy the SSH Key of that created repository.
  3. Open Git Bash in that particular folder which you want to push.
  4. Type git remote add origin PASTE_SSH_KEY_OF_CREATED_REPO
  5. Type git push origin main

This will successfully push that folder to your GitHub account.
Thank You :)


This content originally appeared on DEV Community and was authored by AMAR SINGH


Print Share Comment Cite Upload Translate Updates
APA

AMAR SINGH | Sciencx (2022-06-24T12:42:46+00:00) Pushing folders from local pc to GitHub using Git. Retrieved from https://www.scien.cx/2022/06/24/pushing-folders-from-local-pc-to-github-using-git/

MLA
" » Pushing folders from local pc to GitHub using Git." AMAR SINGH | Sciencx - Friday June 24, 2022, https://www.scien.cx/2022/06/24/pushing-folders-from-local-pc-to-github-using-git/
HARVARD
AMAR SINGH | Sciencx Friday June 24, 2022 » Pushing folders from local pc to GitHub using Git., viewed ,<https://www.scien.cx/2022/06/24/pushing-folders-from-local-pc-to-github-using-git/>
VANCOUVER
AMAR SINGH | Sciencx - » Pushing folders from local pc to GitHub using Git. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/06/24/pushing-folders-from-local-pc-to-github-using-git/
CHICAGO
" » Pushing folders from local pc to GitHub using Git." AMAR SINGH | Sciencx - Accessed . https://www.scien.cx/2022/06/24/pushing-folders-from-local-pc-to-github-using-git/
IEEE
" » Pushing folders from local pc to GitHub using Git." AMAR SINGH | Sciencx [Online]. Available: https://www.scien.cx/2022/06/24/pushing-folders-from-local-pc-to-github-using-git/. [Accessed: ]
rf:citation
» Pushing folders from local pc to GitHub using Git | AMAR SINGH | Sciencx | https://www.scien.cx/2022/06/24/pushing-folders-from-local-pc-to-github-using-git/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.