- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @Juhi Poddar - This is a great guide, I had some additional things that I learnt along the way that might be worth including in your article:
Add Files in Your Fork (Web Browser)
From your fork, select Add file → Create new file.
To make a folder, type the path in the filename box, e.g.
my-folder/README.md.
Add your content. Scroll to the bottom and click Commit new file.
Write a short, clear commit message — e.g. Add example script include.
Each file or edit you save creates a new commit, which is just a snapshot of your change.
Add More Files to the Same Folder
Open the folder you just created.
Click Add file → Create new file again.
Use the same folder path, such as my-folder/code.js.
Commit again — both files now live in the same directory.
Cleaning and Managing Changes
If you’ve added or edited files you don’t want in your PR:
Delete a file: open it, click the trash bin icon, add a commit message, and commit.
Revert a file: view its History, open the previous version, and restore it with a new commit.
Every commit you make updates your pull request automatically.
Reopening a Closed Pull Request
If your PR was closed but not merged:
Go to the repository → Pull requests tab → Closed.
Open your PR and click Reopen pull request.
If your branch was deleted, recreate it in your fork first.
Resetting Your Fork (When Your PR Is Rejected) (And you forget to branch)
Sometimes a PR is rejected or your fork becomes messy. The “Sync fork” button only adds missing commits — it doesn’t remove yours. Here’s how to clean it properly.
Option 1: Codespaces (Recommended)
Open your fork → click Code → Codespaces tab → Create codespace on main.
In the terminal, run:
git remote add upstream https://github.com/ORIGINAL_ORG/REPO.git
git fetch upstream
git checkout main
git reset --hard upstream/main
git push --force-with-lease origin main
Refresh your fork. It should now say
“This branch is up to date with ORIGINAL_ORG:main.”
Hope this helps others who are new to the world of Github!