Welcome to this beginner-friendly repository created especially for our GitHub Workshop!
If you're new to Git, GitHub, or open-source contributions, you're in the right place. π
The goal of this repository is simple:
Help you make your very first Pull Request (PR) and get comfortable with the collaboration process on GitHub.
- β How to fork a repository
- β How to clone it to your local machine
- β How to create a new branch
- β How to make a change and commit it
- β How to push the code back to GitHub
- β How to create a Pull Request (PR)
Before the workshop, please make sure you have:
- Created a GitHub account - Sign up at github.com
- Installed Git on your computer
- Windows: Git for Windows
- Mac:
brew install git
(using Homebrew) or Git for Mac - Linux:
sudo apt-get install git
(Ubuntu/Debian) orsudo yum install git
(Fedora)
- Set up Git with your identity:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Click the Fork button at the top-right corner of this page.
This will create a copy of this repository under your GitHub account.
Now clone the forked repository to your local machine using:
git clone https://github.com/YOUR-USERNAME/first-pr-repo.git
cd first-pr-repo
π‘ Pro Tip: Replace
YOUR-USERNAME
with your actual GitHub username!
Use the following command to create a new branch:
git checkout -b my-first-contribution
This creates a new branch called my-first-contribution
and switches to it automatically.
Open the index.html
file in a code editor of your choice and add your name in the following format:
<li>
Your name - I am from ___ !
</li>
Save the file after making your changes.
After making your changes, run the following commands:
git add .
git commit -m "Add my name to the contributors list"
The first command stages your changes, and the second command creates a commit with your changes and a descriptive message.
Push your branch using:
git push origin my-first-contribution
This sends your new branch with the committed changes to your fork on GitHub.
- Go to your forked repository on GitHub
- Click on the Compare & pull request button that appears at the top
- Add a title and description to your PR
- Click Create pull request
- Forked the repository
- Cloned the repository
- Created a new branch
- Made your changes
- Committed your changes
- Pushed the branch to GitHub
- Opened a Pull Request
- Repository (Repo): A storage location for a project containing all of its files and history
- Fork: A personal copy of someone else's repository
- Clone: Creating a local copy of a repository on your computer
- Branch: A parallel version of the repository that doesn't affect the main branch
- Commit: A saved snapshot of your changes
- Push: Uploading your local changes to a remote repository
- Pull Request (PR): A request to merge your changes into the original repository
- Merge: Combining changes from one branch into another
If you get stuck or have questions, feel free to reach out!
Connect with me on LinkedIn π€: Patel Muhammad
Congratulations on taking your first step into the world of open source!
We can't wait to see your pull request. π
Happy Coding! π»