Git Notes

October 25, 2021

To not search all across the internet again.

Fetch upstream

git remote add upstream <official repo address>
git fetch upstream
git reset --hard upstream/master

New contribution

git checkout -b my-awesome-branch
# Your changes
git add .
git commit
git push -u origin my-awesome-branch

Once pushed in origin, you can just use push without arguments.

Use ssh in https repo

git remote add my-ssh <ssh-url>
git push -u my-ssh branch-name

Squash commits

git add .
git commit --amend