mkdir <folder_name>
cd ../<folder_name>
git clone <fork-url>
git remote add upstream <original-repo>
git checkout -b <branch-name>
# make changes
git add .
git commit -m "message"
git push origin <branch-name>If things do not appear automatically on the repo page asking to compare and pull, then do this:
https://github.com/<owner>/<repo>/compareSafety from brnaching through regular pull and rebase
mkdir <folder_name>
cd <folder_name>
git clone <fork-url>
cd <repo-name>
git remote add upstream <original-repo>
git fetch upstream
git checkout main
git pull upstream main
git checkout <branch-name>
git pull upstream <branch-name>
git checkout -b <branch-name>
# make changes
git add .
git commit -m "message"
# safety sync before pushing
git fetch origin
git pull --rebase origin <branch-name> # if branch already exists remotely
# if shows fatal/ conflict (auto merge failing); resolve conflicts and proceed with further steps
git add .
git rebase --continue
# repeat these two steps until sorted (or until taken to commit page)
git push -u origin <branch-name>
# creates the compare and pull request on main page
gh pr create --webTo visualise branching
git log --oneline --graph --decorate --allTo understand what went wrong
git fetch origin
git status
git branch -vv
git log --oneline --graph --decorate --all -20mkdir -p /Users/shaarav/Documents/<Folder>/.../<Folder>/<Project>cd /Users/shaarav/Documents/<Folder>/.../<Folder>/<Project>- Open GitHub
- Click Fork
- Fork into your own account
git clone <YOUR_FORK_URL>cd <repo-name>git remote add upstream <ORIGINAL_REPO_URL>git remote -vExpected:
origin <YOUR_FORK_URL>
upstream <ORIGINAL_REPO_URL>git fetch upstreamgit checkout maingit reset --hard upstream/maingit push origin main --forcegit checkout -b <feature-branch-name>Examples:
git checkout -b fix-auth-race-condition
git checkout -b improve-logging
git checkout -b add-rate-limiteropen -a "Antigravity" .open -a "Visual Studio Code" .open -a "Cursor" .open -a "Codex" .git statusgit diffgit diff --staged<project-test-command>Examples:
npm test
cargo test
pytest
pnpm testgit add .OR specific files:
git add <file-name>git commit -m "<commit-message>"Good examples:
git commit -m "Fix race condition in websocket handler"
git commit -m "Improve MongoDB reconnection logic"
git commit -m "Add validation for empty API keys"Avoid:
git commit -m "fix"
git commit -m "changes"
git commit -m "update"git push origin <feature-branch-name>- Navigate to your fork
- Click Compare & Pull Request
Use clear titles:
Fix websocket memory leak
Add retry logic for failed requests
Improve error handling in auth middleware
Avoid:
Fixed stuff
Changes made
Update
## What does this PR do?
-
## Why is this needed?
-
## Changes made
-
-
-
## Testing done
-
## Screenshots / Recordings (if applicable)
-
## Checklist
- [ ] Code builds successfully
- [ ] Tests pass
- [ ] No unnecessary files added
- [ ] Documentation updated if needed
- [ ] PR is focused on one issue onlygit fetch upstreamgit checkout maingit reset --hard upstream/maingit checkout <feature-branch-name>git rebase mainIf conflicts happen:
git statusResolve conflicts manually, then:
git add .
git rebase --continuegit push origin <feature-branch-name> --forcegit checkout maingit branch -D <feature-branch-name>git push origin --delete <feature-branch-name>- Keep PRs focused on ONE issue/problem
- Avoid unrelated formatting changes
- Avoid huge PRs unless necessary
- Test before opening PR
- Re-read changed code before pushing
- Keep commit messages meaningful
- Respond to review comments properly
- Never commit secrets/API keys/.env files
- Avoid AI-generated code without reviewing it carefully
- Prefer clarity over over-engineering
git log --oneline --graph --allgit log --onelinegit reset --soft HEAD~1git reset --hard HEAD~1git clean -fdgit rebase --abortgit merge --abort