Uploading Existing Project to GitHub
Initiate and upload your local git repo to GitHub using these steps.
Hey there! You searched for this so I'm guessing you really need to know how to do this. (Or you're subscribed to my newsletter. If you're not...you're missing out bud. 😉).
Let's get right to it then:
Firstly, create your repository on the GitHub. Log into the GitHub website and click on the (+) symbol on the top right of the navigation bar.
Give your repository a name, scroll down and click "Create Repository".
In your command line (Command Prompt, Shell, etc), cd (change directory) into your project folder.
If you haven't initiated Git, let's do so now. (Note, some JS frameworks initiate Git from the inception, so you can skip this step if that was already done).
$ git init -b main
- Add all of your files to the git repo you just initiated:
$ git add .
- Commit the files you just added to the repo:
$ git commit -m "First commit"
- You now have to connect your current local initiated git repository to github. You do so by adding the URL to the below command
$ git remote add origin <repo_url>
- Then verify the url
$ git remote -v
- Finalize this process now, by pushing the changes you've committed to GitHub
$ git push -u origin main
You can now refresh your GitHub repository page and you will see the files are uploaded. 😉
Hope this helps with you with your project. This was something that puzzled me as well, so I'm happy to have shared this information with you. :)
Happy Coding! 🎉✨