git fetch origin
git co main && git pull
git co main && git co -b my-new-feature
{run tests} && git add -p && git commit -m"adds the thing to the other thing"
git push -u origin my-new-feature
git fetch origin && git rebase origin/main
I also like to push frequently. All the rebasing can make things a bit more interesting, so I do this alot:
git push --force-with-lease
Whenever I've been away for a bit, I like to begin by pulling from the remote repository, and I prefer to pull with a rebase so that my local changes will be written after the new remote changes:
git pull --rebase