# Contributing To An Open Source by A First-Timer (Part 1)

Hello Fellow Codenewbies 👋

If you are self-taught, maybe you have a similar experience as mine.
<br>
As a self-taught, I only use "git" to push *my own project* to *my own repository*.

Also, other than the default (`main`) branch, I never create any other branch to work with.
<br>
I always create solo projects. And my naive thought says, '*I don't see the need of creating another branch because I will push my changes directly to my `main` branch'*.
<br>

## There Would Be A First Time For Everything

I have never thought of taking part in **Hacktoberfest** or contributing to any open-source out there simply because the idea of doing one is too overwhelming. I don't see many *beginner-friendly* repos to contribute to.

But this year - *thanks to my beautiful community **[Virtual Coffee](https://virtualcoffee.io/)*** - I got the experience contributing to its open-source.
<br>
*(📢 Special thanks to **Dan Ott** for the clear written instructions and **Mike Rogers** for helping me out executing one when I was shaking!)*

## From Forking Until Committing 

1. 
[Fork](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/github-glossary#fork) a repo
<br>
Open the repo we want to contribute to on GitHub and click the fork button on the top right.

2. 
[Clone](https://docs.github.com/en/free-pro-team@latest/github/using-git/which-remote-url-should-i-use#cloning-with-https-urls) the repo
<br>
   -  Click the green "Code" button and copy the HTTPS URL.
  -  In the terminal, navigate to the location where we want to store the repo.
```bash
cd new-project-storage
``` 
  - Now it's time to use this command to clone the repo and paste the copied HTTPS URL as `repo-url`.
```bash
git clone <repo-url>
``` 

3. 
Create a [new feature branch](https://www.atlassian.com/git/tutorials/using-branches)
<br>
This branch would be our working branch, where we will commit our changes and the branch that we push later on to the `upstream` repo.
```bash
git branch <branch-name>
``` 

4. 
[Navigate](https://www.atlassian.com/git/tutorials/using-branches/git-checkout) to the feature branch
<br>
This is to ensure that we are in the branch where we will make changes before working on it, so we don't accidentally push our changes to the `main` branch.
```bash
git checkout <branch-name>
``` 
#### 📝 *Additional Note*
There is a shortcut to create a branch and navigate it automatically to the new branch:
```bash
git checkout -b <branch-name>
``` 
5. 
[Add and commit](https://docs.github.com/en/free-pro-team@latest/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line) changes
<br>
After we finish working on our changes, let's add them to the staging area.
```bash
git add .
``` 
Then commit the changes.
```bash
git commit -m "The message of our changes"
``` 

<br>
### ☕☕☕
We're done with all the steps from forking the repo until committing our changes.
<br>
Now let's take a coffee break before we create the `Pull Request`, which I will continue in the next post.

### ⚠ *Reminder*
**Don't push our changes before reading the [next post](https://adiatiayu.hashnode.dev/contributing-to-an-open-source-by-a-first-timer-part-2)!**

---

Thank you for reading!
<br>
Last but not least, you can find me on [Twitter](https://twitter.com/AdiatiAyu). Let's connect! 😊
