This repository will guide you through the process of contributing to open source on GitHub.
Click to install Git on your machine.
To avoid any errors, follow these steps after installing Git:
- Open a terminal and run the following command to set your Github username:
git config --global user.name "username"
- Set your Github email with the following command:
git config --global user.email "[email protected]"
Note: Make sure to do this only during the first time installing Git.
-
Fork this repository by clicking the fork button. This will create a copy of the repository in your own account.
-
Go to your account and open the forked repository. Click on the code button to copy the link.
-
Run the following command to clone the repository to your machine:
Example
git clone https://github.com/your-username/opensource.git
-
Change the directory to the newly cloned repository:
cd opensource
It is best practice to create a new branch. Run the following command in the terminal:
git checkout -b anyname
While still in the terminal, open the name.md
file (located inside the opensource folder).
- Add your username and Github profile link to the
name.md
file. - Save the file and go back to the terminal.
- Run the following command to stage the changes:
git add .
- Commit the changes with a descriptive message, using your username:
make sure to use "commas " after -m
git commit -m "added (your_github_username) in the name.txt"
git commit -m "added (samadpls) in the name.txt"
- Push the changes to the remote branch with the following command:
git push origin -u your-branch-name
If the above command gives an error, run the following command instead:
git config --global push.autoSetupRemote true
if error not resolve watch this video YouTube
Go to your Github account and you will see the option to create a pull request. Merge the changes into your repository and then create a pull request.
After merging it in your repository, open my repository again and create a pull request by going on the pull request option, then you will see this option
set dropdown compare option and select your repo, and send pull request.
mention issue #60 in PR description
Congratulations, you now know how to contribute to open source!
Contributor |
---|
If you stuck somewhere or getting any error you can also check the YouTube video
HELP
Inspired by First-contribution