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 --force
This will successfully push that folder to your GitHub account.
Thank You :)
Top comments (0)