This repository helps to kick-start your Open Source journey and makes you comfortable, while creating a PR and registering a contribution.
I know, there are a lot of other repositories out there to make you comfortable with Open Source contributions, but that is the beauty of it ! When you go Open Source, you will find a lot of like minded people working together, making the community strong, helping each other with their problem (most of the time similar problem) and giving back to the community.
Make sure you have read CONTRIBUTING.md in .github folder of this repository.
Jump to any point, follow them step-by-step to register your PR and do a contribution to this repository:
This will go through creating a local repository on your computer and using terminal to do most of the work.
Then we need to clone the forked repository (the same repository have been created under your username, <your-username>/hello-open-source).
I will be doing that in Documents, you can create your own folder to keep all your projects at one place (please make sure git is installed on your machine).
git clone <https-link-you-copied>
It will look something like this
git clone https://github.com/siddharth20206/hello-open-source.git
☞ Let's, checkout to a branch (it will start pointing to a branch instead of master/main)
Change directory to cloned repository
cd hello-open-source
git checkout -b <your-branch-name>
Something like this
git checkout -b hello_siddharth20206
Verify you did it right
git status
Press enter and you should see something like this
On branch hello_siddharth20206
nothing to commit, working tree clean
Look at the directory/location where you cloned the repository, you should be able to see a folder named hello-open-source. Open this folder.
Now open folder named hello.
Create a new file inside that folder, that file can be any text file, python file, java file, markdown file or any other file as long as it's content shows/print Hello Open Source (or hello open source).
Now before saving your file, please follow this naming convention - hello_<your-github-username>.<file-extension>.
Here, enter your github username (like siddharth20206) in place of <your-github-username> and file extension (either txt, md, py, java, c, cpp etc..) in place of <file-extension>.
Following are the example of python file, text file and markdown file content (please make sure you write it yourself to make a habit, otherwise you are free to copy !).
Python (.py)
print("Hello Open Source")
Text (.txt)
Hello Open Source
Markdown (.md)
**Hello Open Source**
Make sure your file shows Hello Open Source, either by printing it out as a program or simply a comment in that file (it is a necessary requirement for your PR to be merged with this repository).
Go to terminal, type this and press enter
git status
You should see something like this
On branch hello_siddharth20206
Untracked files:
(use "git add <file>..." to include in what will be committed)
.DS_Store
hello/hello_siddharth20206.py
nothing added to commit but untracked files present (use "git add" to track)
☞ It means you have some changes that are not staged yet, which we need to do next !
Type the following on terminal/command prompt and press enter
git add hello/hello_<your-github-username>.<file-extension>
Something like this
git add hello/hello_siddharth20206.py
Now you have added the file to staging area. Next comes writing the commit message, make it meaningful (even though you are doing this for the first time, it's better to do practice on writing good commit messages from start itself).
git commit -m "create hello_siddharth20206.py"
Now you committed the file with a proper message, but the changes are still in your local repository, we need to push them to remote repository. (yes, to the one you forked)
git push origin <your-branch-name>
Here origin is your forked repository reference and <your-branch-name> is where your changes will be pushed to remote location.
Something like this
git push origin hello_siddharth20206
Enter your username and password, and you are all set !
Don't want to enter github username/password everytime you push to remote ? - What is git credential store ?
Excellent, all that remains now is to create a pull request, go back to your github forked repository and you should be able to see something like this.
It will allow your changes to be merged with master branch of actual repository siddharth2016/hello-open-source.
Write a meaningful PR message like this
create hello_siddharth20206
Later when this repository gets updated, please make sure your forked repository is in perfect sync with the actual current repository (siddharth2016/hello-open-source) or you can delete it after successful contribution !
The following steps will focus on how you can create your first PR and do contribution using GitHub alone.
The same repository have been created under your username, <your-username>/hello-open-source.
Now before committing your file, please follow this naming convention - hello_<your-github-username>.<file-extension>.
Here, enter your github username (like siddharth20206) in place of <your-github-username> and file extension (either txt, md, py, java, c, cpp etc..) in place of <file-extension>.
Following are the example of python file, text file and markdown file content (please make sure you write it yourself to make a habit, otherwise you are free to copy !).
Python (.py)
print("Hello Open Source")
Text (.txt)
Hello Open Source
Markdown (.md)
**Hello Open Source**
Make sure your file shows Hello Open Source, either by printing it out as a program or simply a comment in that file (it is a necessary requirement for your PR to be merged with this repository).
Next comes writing the commit message, make it meaningful (even though you are doing this for the first time, it's better to do practice on writing good commit messages from start itself).
You should see something like this
It will allow your changes to be merged with master branch of actual repository siddharth2016/hello-open-source.
Write a meaningful PR message like this
Following repositories could be your next stop to further practice creating a PR and do a contribution.
Wait for at most 24 hours to see your first contribution on your profile !
That's it, if you followed the above steps, you should have been able to create your first PR and your first contribution to Open Source !
It would be kind of you to spread the word, give this repo a star and help others in their open source journey.
I receive no commission or incentives for your participating in either this project or entering the Hacktoberfest event.