🔌 Toolbox of short, reusable pieces of code and knowledge.
This is a simple guide on how to push native source files from the command line to a Github repository.
git init
Then, add the files to the staging area:
git add .
Commit the additions:
git commit -m "Initial commit"
Connect to Github:
git remote add origin <git-repo-url>
Set branch:
git branch -M main
Push the commit:
git push -u origin main
Every time you want to update the Github repo, simply do:
git add .
git commit -m "Another commit"
git push -u origin main
pull
Let’s say someone updates the remote repository on Github but of course your local folder will stay the same. To update your native folder to reflect the changes, use git pull
:
git pull origin <branch-name>
See here for more.