Anyone can be an open source contributor! Remember as you try these steps out, you can't break things here. Feel free to experiment!
You can still help and practice by contributing to the documentation!
You can edit almost any file type from
the GitHub website by clicking on the file in the file list, which opens a page
like this README.
The README is a file that ends with .md
that is shown in the home page of a project in GitHub. MD stands
for markdown. A markdown file is just a weirdly formatted text file.
Whether you want to edit a markdown file or something else, click on the edit/pencil icon and walk through making a commit and pull request, all from the website itself.
For a step-by-step guide that includes explanations for each step, see this article
For this repository, here are the steps you could practice:
- Create or sign into a free GitHub account
- Create or comment on an issue here
- Fork the repository by clicking Fork in the top right hand corner
- Clone the repository using command line or GitHub Desktop tools (see Troubleshooting if you cloned the main repo and want to remove it)
- Create a git branch with a unique name,
git checkout -b your-own-branchname
, no spaces in the branch name - Make your changes
git status
to review the files you changed, andgit diff
to see which lines of code changed- Mark the files that you want to save with
git add path/to/the/file/you/changed.js -p
A prompt will appear for each changes you have done per page or block of code you contributed to. You just need to addy
orn
to respectively approve the change and add it, or decline it (and it won't be added). - Commit the changes with
git commit -m "a short message including the issue number #123"
git push origin main
to add your work to the online code hosted on GitHub, on your own fork- Open a pull request by going to your fork, the pull request tab, and open pull request. This project and branch "main" should be the base. Choose your branch from the "compare" dropdown. Choose Create Pull Request. In the message, put a link to the Issue you created or commented on, and click Create to finish. Ta da!
I've cloned the main repo and I want to remove it locally (and start over with a forked repo)
First you need to go one folder up:
cd ..
Then enter the command to remove the repo. Be careful with -rf
, because it deletes things forever from your computer.
rm -rf our-open-source-contributions
Once done you can check if the repo has been deleted locally:
ls
+ TAB
--> The repo should not be present in the list anymore