- install git on your machine
- signup on github.com, get a username and remember your password
- make a repository on github.com
- get the push link to repo (must end with .git ex)
- go to terminal, and to the folder from where you want to upload your files
- run command :
git init
- this will create a empty local repo in your local space (in pwd)
- now write command:
git pull THE-LINK-YOU-COPIED-FROM-STEP-4.git master
for example:
git pull https://github.com/sambhav2612/golang.git master
- this command will import everything from your remote repo (github) and branch
master
on the repo tree to your local machine (terminal git)
- now add all your files using:
git add . -f
- wait for all files to be compressed and added, then commit your changes:
git commit -m "YOUR-COMMIT-MESSAGE"
. commit message is the brief description for the changes you made now. commit is nothing but a staging process where your changes to the remote repo (github) are aligned to be pushed online (^_^ )
- now that you have commited your changes, wirte this command to push them to your github repo:
git push THE-LINK-YOU-COPIED-FROM-STEP-4.git master
for example:
git push https://github.com/sambhav2612/golang.git master
- wait for the commit message, and you are done. refresh your browser tab tp see your changes.