Git Commands
- Init an empty repository.
git init- add remote, using
httporsshmethod - origin is just a naming for your remote
git remote add *origin* {url}- fetch all from remote
git fetch --all- reset everything to your online repository
- —hard will delete all your local changes!
git reset --hard *origin*/{branch_name}- show list of branches
git branch- switch or create branch
git checkout {branch_name} - pull from remote, might need to fix commits
git pull- rebase, add in changes and align with commit dates
git pull --rebase- merge, add a merge commit message to show all the changes
git pull --merge- stage all your changes, add . is stage all changes, you can add specific if needed
git add .- commit your staged changes
git commit -m "{commit_message}" - push your commits to online repo
git push origin {branch_name}I actually prefer using git client such as Fork, so you can get rid of all these commands