git init git add . git commit -m "Initial commit" git remote add origin https://github.com/prasanthcp/pebble.git git branch -M main git push -u origin main
- Open the original repository.
- Click Fork → create your own fork.
git clone <forked-repo-url>
cd <repo>git remote add upstream <original-repo-url>
git remote -v # verifygit checkout -b feature/my-change- Edit files
- Add new files
Stage and commit:
git add .
git commit -m "Describe your change"Fetch latest original repo code:
git fetch upstream # fetch changes to upstream remote mainUpdate your local main:
git checkout main
git merge upstream/main # merges upstream changes to local main Rebase your feature branch on updated main:
git checkout feature/my-change
git rebase maingit add <file>
git rebase --continuegit push origin feature/my-change- Go to GitHub → your fork
- GitHub detects the new branch
- Click Compare & Pull Request
- Select:
- base repo = original repo
- base branch = main (or relevant branch)
- compare branch = your feature branch
Submit PR.
If reviewers ask changes:
# edit
git add .
git commit -m "Address review comments"
git push origin feature/my-changePush again → PR updates automatically.
git checkout main
git fetch upstream
git merge upstream/main # git pull = git fetch + git merge (from origin/main)¯
git push origin maingit clone <forked-url>
cd <repo>
git remote add upstream <original-url>
git checkout -b feature/my-change
git add .
git commit -m "msg"
git fetch upstream
git checkout main
git merge upstream/main
git checkout feature/my-change
git rebase main
git push origin feature/my-changeThis guide contains every essential command and sequence for real open‑source contribution.