According to Tomiwa, Git and GitHub are two symbiotic tools for developers. Git on one hand is a version control tool (like a file's registry) used to keep track of a particular codebase and all it's history right from initiation, this helps you manage the code base, ensure seamless versioning (eg v1, v2...)
GitHub on the other hand is a cloud hosting system designed to help maintain all your git repository, thus the term 'symbiotic'.
To push your project to GitHub after coding
- An established project on your local disk
- Install Git on the PC (you can install Git by downloading from http://git-scm.com).
- Open git bash and navigate to the folder where the files you want to push are. Then initialize git
- Add your files
git add .
It automatically adds all the files in that folder to git and it will be able to track them.
- Commit your files with a custom message. It will commit and notify git that you want to push these files online. Make your commit message as descriptive as possible.
-git commit -m "Custom Message"
- Add your Github repository as a remote
git remote add origin email@example.com:User/UserRepo.git
where User is your username and UserRepo is your repository name.
- Push your code to GitHub. This means you are pushing to a branch named 'main' on a remote repository on Github
-git push origin main