Thanks for taking part in the BitPolito Git & GitHub workshop!
This repository is a practice playground, so contributing here is part of the exercise: every contribution is a chance to learn the real workflow used in open source projects. Please read the rules below before opening your Pull Request (PR).
- Code of conduct
- What you can contribute
- Getting started
- Branch naming
- Contributor file format
- Commit messages
- Opening a Pull Request
- Reviewing someone else's PR
- Resolving conflicts
- Need help?
Be kind and respectful. Everyone here is learning, and mistakes are expected and welcome.
- Be patient with beginners and give feedback constructively.
- No offensive, discriminatory or inappropriate content in files, commits, PRs or comments.
- Don't share personal information (yours or other people's) that you don't want to be public.
- Your contributor file in the
contributors/folder (the main workshop exercise). - Fixes and improvements to the documentation, such as typos, unclear explanations or broken commands.
- Review comments on other participants' PRs.
Please keep each PR focused on one thing only.
Follow the full step-by-step exercise in the README. In short:
-
Make sure Git is installed and configured with your name and email:
git config --global user.name "Your Name" git config --global user.email "you@example.com"
-
Clone the repository and move into its folder:
git clone git@github.com:BitPolito/git-workshop.git cd git-workshop -
Create your own branch from an up-to-date
master:git switch master git pull git switch -c your-name
If you don't have write access, ask the instructors to add you as a collaborator, or fork the repository and open the PR from your fork.
- Use lowercase letters and hyphens only.
- Name your branch after yourself:
ada-lovelace. - For anything other than your contributor file, use a short prefix:
fix/short-descriptionfor fixes (e.g.fix/readme-typo)docs/short-descriptionfor documentation changes
- Never commit directly to
master.
Create a file named contributors/your-name.md, using the same name as your branch, with this content:
# Your Name
- **GitHub:** @your-username
- **Favorite Git command:** git something
- **Why I'm here:** a short sentenceRules:
- Only add or edit your own file. Don't touch other people's files.
- Keep it short, friendly and safe for work.
- Don't include private data such as phone numbers, home addresses or passwords.
A good commit message is short, written in the imperative mood, and says what the commit does.
| ✅ Good | ❌ Avoid |
|---|---|
Add Ada Lovelace to contributors |
stuff |
Fix typo in README |
fixed things!! |
Update favorite command |
asdfgh |
Guidelines:
- Keep the first line under about 72 characters.
- Start with a verb:
Add,Fix,Update,Remove. - One logical change per commit.
Before you open the PR, check that:
- Your branch is named correctly.
- You only changed the files you intended (check with
git statusandgit diff). - Your commits have clear messages.
- Your contributor file follows the format.
Then:
-
Push your branch:
git push -u origin your-name
-
On GitHub, click Compare & pull request.
-
Set the base branch to
masterand the compare branch to yours. -
Write a clear title (e.g.
Add Ada Lovelace to contributors) and a one-line description. -
Click Create pull request.
If a reviewer asks for changes, just commit and push to the same branch: the PR updates automatically.
Reviewing is part of the exercise! Leave at least one comment or approve the PR of the person next to you.
When reviewing, check that:
- The file is in
contributors/and named correctly. - The content follows the template.
- The commit message is clear.
Be specific and kind. Prefer "Could you rename the file to match your branch?" over "Wrong name."
Once a PR has been reviewed, it can be merged with Merge pull request. Afterwards, update your local copy:
git switch master
git pullA conflict happens when Git can't decide which version of a line to keep. If you get one:
-
Open the conflicting file and look for the markers
<<<<<<<,=======and>>>>>>>. -
Keep the lines you want and delete the markers.
-
Stage and commit the result:
git add <file> git commit
-
Push again.
| Problem | What to do |
|---|---|
| I changed a file and want to discard it (not committed) | git restore <file> |
| I need to set my work aside for a moment | git stash, then git stash pop to get it back |
| I committed something already shared and it's wrong | git revert <commit> |
| I don't know where I am | git status and git log --oneline |
| I'm stuck | Raise your hand or open an issue: it happens to everyone |
Made with 💙 by BitPolito