-
Notifications
You must be signed in to change notification settings - Fork 0
Home
abby-ql edited this page Mar 19, 2026
·
1 revision
git clone <repo-url>
cd <repo-name>Always branch off the latest main:
git checkout main
git pull upstream main # or origin main
git checkout -b feature/your-feature-nameCheck changes:
git statusStage files:
git add .
# or
git add <file>Commit:
git commit -m "feat: add xyz"git push origin feature/your-feature-name-
After pushing, go to GitHub
-
Click Compare & pull request
-
Add:
- Clear title
- Description
- Testing notes
-
Request reviewers
git checkout main
git pull upstream main
git checkout feature/your-feature-name
git merge maingit checkout feature/your-feature-name
git fetch upstream
git rebase upstream/mainWhen Git says there are conflicts:
- Open the conflicted files
- Look for markers:
<<<<<<< HEAD
Your changes
=======
Incoming changes
>>>>>>> branch-name
- Edit to keep correct logic
Then:
git add .If merging:
git commitIf rebasing:
git rebase --continueAbort if things go wrong:
git rebase --abortAfter successful rebase, force push:
git push --force-with-lease** Never use force push on shared branches like main
git status
git log --oneline --graph
git diffFix:
git pull upstream mainFix:
git checkout correct-branch
- Use clear branch names
- Keep PRs small and focused & link PR to the specific issue
- Pull latest main frequently
- Write meaningful commit messages
- Test before pushing
- If someone merged a PR before expect conflicts
- Always re test after resolving conflicts
git checkout main
git pull upstream main
git checkout -b feature/x
# work
git add .
git commit -m "message"
# open PR
git push origin feature/x