"Little things can have a big impact on our daily life. Playing with Git is very exciting. As a beginner, solving minor issues provides great motivation. This is how I push code into GitHub."
- Run
git init
in the terminal. This will initialize the folder/repository that you have on your local computer system.
Run git add . in the terminal. This will track any changes made to the folder on your system, since the last commit. As this is the first time you are committing the contents of the folder, it will add everything.
- Run
git commit -m
"insert Message here". This will prepare the added/tracked changes to the folder on your system for pushing to Github. Here, insert Message here can be replaced with any relevant commit message of your choice.
- Run
git remote add origin https://github.com/manishwin/tic-tac-toe.git
in the terminal. Here, manishwin and tic-tac-toe will be replaced by the values provided in the copied link. This will push the existing folder on you local computer system, to the newly created Github repository.
- Run
git remote -v
. This does some git pull and git push magic, to ensure that the contents of your new Github repository, and the folder on you local system are the same.
- Run
git push origin master
. Note that the last word in the command master, is not a fixed entry when running git push. It can be replaced with any relevant “branch_name”.
Top comments (2)
Keep it up!
Thanks