- Login to your GitHub account and create a new repository.
- Copy the generated URL which looks something like this: https://github.com/iamoperand/test123.git
- Now, create a new folder in your system.
- Open terminal in that location and then follow the following commands:
git init //to initialise GIT in the target location
git add --all //to add all the files (staging is what it means, done just before committing)
git commit -m "Write your commit message"
- Now is the time to link both the project that you have in your system to the online repository that you created in GitHub.
git remote add <nick name> <copied URL which you got from step 2> //origin is used as a nickname as default
Example: git remote add origin https://github.com/iamoperand/test123.git
- Now, that you have created a link between both the repositories i.e. the local and GitHub one, we will push our local code to the online GitHub repo.
git push <nick name> <branch name> //master is the default branch name
Example: git push origin master
- You are all set. Now just open the respective GitHub URL and see your pushed code online :)