Follow this workflow to contribute efficiently and keep the repository clean and organized.
- sync main
- create feature branch
- work & commit
- push changes
- pull request & code review
- integration (once approved)
- push
- cleanup (after merge)
git switch main
git pull --ff-only --prunegit switch -c BRANCH_NAMEgit add FILES
git commit -m "COMMIT_MSG"(Optional: fix up past commit)
git add FILES
git commit --fixup=COMMIT_SHA
git fetch origin
git rebase -i --autosquash origin/maingit fetch origin
git rebase -i origin/main
git push --force-with-lease origin BRANCH_NAME- Open a PR on GitHub
- Ensure CI passes
- Request reviews
git switch main
git pull --ff-only
git merge --ff-only origin/BRANCH_NAMEIf --ff-only refuses:
git switch BRANCH_NAME
git rebase main
git switch main
git merge --ff-only BRANCH_NAME(Or use GitHub “Rebase & merge” button.)
git push origin maingit push origin --delete "BRANCH_NAME"
git branch -d "BRANCH_NAME"
git fetch --prune(Optional)
git gc --prune=now