Press s for speaker notes
$ git init
$ git clone https://some.website/repo.git # eg $ git clone https://github.com/jeetelongname/example.git # you can actually clone this
git status
git add file git add .
git restore --staged file # removes file from the stage git restore --staged . # removes all staged changes git reset # also works git config --global alias.unstage 'restore --staged' git unstage file
git commit # opens an editor where you type a message git commit -a # commit all changes git commit -m "commit message provided here"
git branch <branch_name> git branch <branch_name> <base_branch_name> git branch -d <branch_name> git branch -D <branch_name>
git checkout <branch_name> # switch to that branch git checkout -b <new_branch_name>
git checkout master git merge feature # merge feature into master git merge master feature # merge feature into master
git checkout feature git rebase master # rebase master onto feature git rebase feature master # samething but one line
git remote add <remote_name> https://your.url.here/repo.git git remote add origin https://github.com/jeetelongname/example.git git remote set-url origin https://git.sr.ht/~jeetelongnamr/example.git # not real git remote rename orign upstream git remote remove upstream
git push origin master git push -u origin devel # pusing for the first time git push origin master --force # overwrite the remote
git fetch origin # fetch all of the branches named origin git fetch origin some-branch git checkout some-branch
git pull origin master # merges git pull -r origin master # rebases
git revert b4e73eef1e7a1620... # full hash works git revert b4e73 # also works git revert HEAD~1 # roll back one commit