0. If there are unstaged changes, stage and commit those changes before pulling and rebasing.
git add .
git commit -m "oops I left a mess"
1. Fetch the latest changes from main
in the origin
remote and then rebase your current branch onto the latest main
.
git pull --rebase origin main
2. Make some changes—i.e., code up a sick solution.
3. Stage all new and modified files.
git add .
4. Commit the changes to the local repository.
git commit -m "sick commit message"
5. Push the main
branch to the remote repository to reflect the committed changes.
git push origin main