This guide explains the standard workflow for contributing to a GitHub project using forks and pull requests (PRs).
- Navigate to the repository you want to contribute to.
- Click the Fork button on the top-right corner of the page.
- This creates a copy of the repository under your GitHub account.
Clone your fork to your local machine so you can work on it:
git clone https://github.com/<your-username>/mLauncher.git
cd mLauncher
Set the original repository as the upstream remote to stay updated:
git remote add upstream https://github.com/CodeWorksCreativeHub/mLauncher.git
git fetch upstream
Always create a new branch for your changes:
git checkout -b feature/my-new-feature
Replace
feature/my-new-featurewith a descriptive branch name.
- Edit files, fix bugs, or add features.
- Stage and commit your changes:
git add .
git commit -m "Add a clear, descriptive commit message"
Before pushing, make sure your fork is up to date:
git fetch upstream
git checkout main
git merge upstream/main
Resolve any merge conflicts if necessary.
Push your branch to your fork:
git push origin feature/my-new-feature
- Go to your fork on GitHub.
- Click Compare & pull request.
- Ensure the base repository is the original repository and the base branch is
main(or the target branch). - Add a descriptive title and detailed description.
- Submit the pull request.
- Collaborators may request changes.
- Make edits locally, commit, and push to the same branch.
- The PR will automatically update.
Once approved and merged:
- Delete your feature branch locally and on your fork:
git branch -d feature/my-new-feature
git push origin --delete feature/my-new-feature
- Sync your fork with upstream again for future contributions:
git fetch upstream
git checkout main
git merge upstream/main
git push origin main
- Always pull the latest changes from upstream before starting.
- Keep commits small and focused.
- Write clear commit messages.
- Be responsive to feedback on your PR.
Happy Contributing! 🚀