here, we have learnt how to create files in our local repository, open an empty repository, then push the files from our local repository to github.
-
to push a file:
- open the file on your local computer
- initialise git using git init syntax
- add the file(s) using git add 'filename' syntax
- commit the file(s) using git commit -m 'commit message' syntax
- go to your github account and a create an empty repository
- push the file(s) using the git push origin main 'ssh or https link' syntax
- tada! you are good to go.
-
to retrieve a file from github:
- first of all, fork the repository
- then clone the repository to your local computer
- then clone the upstream branch.
you can read more here.