Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 24, 2022 12:42 pm GMT

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, 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 :)


Original Link: https://dev.to/amarsingh/pushing-files-from-local-pc-to-github-using-git-3ib6

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To