An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
June 24, 2022 12:42 pm GMT
Original Link: https://dev.to/amarsingh/pushing-files-from-local-pc-to-github-using-git-3ib6
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-
- Open Git Bash in that particular folder.
- Type
git init
(this will make that folder a repository) - Type
git add .
(this will add all files to the repository) - Type
git commit -m "Intial commit msg"
(all files now in repository) - 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-
- Open your GitHub profile and create a New Repository.
- Copy the SSH Key of that created repository.
- Open Git Bash in that particular folder which you want to push.
- Type
git remote add origin PASTE_SSH_KEY_OF_CREATED_REPO
- 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:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To