DEV Community

Cover image for Git and Github ~getting started with opensource
Benjamin Rukundo
Benjamin Rukundo

Posted on

Git and Github ~getting started with opensource

What is open source?

Open source software is software with source code that anyone can inspect, modify, and enhance.

"Source code" is the part of software that most computer users don't ever see; it's the code computer programmers can manipulate to change how a piece of software—a "program" or "application"—works. Programmers who have access to a computer program's source code can improve that program by adding features to it or fixing parts that don't always work correctly

Making your first contribution

Being able to make your first contribution might seem overwhelming but with these few steps am sure you'll properly get the hang of what exactly to do.

How to contribute?

1.Fork the project
image

2.Make any changes in your forked repo
3.On this repo, click Pull Requests and raise a Pull Request selecting your fork on the right drop down

Questions can be asked by raising an Issue.

How to clone repo and make changes locally?

  • Click on the clone button (green in color). This gives you a copy
    of the project. It's now yours to play around with.
    image

  • Using Git on your local machine. Do this to download the forked copy of this repo to your computer.

  git clone https://github.com/yourGithubUsername/nameOfProject.git
Enter fullscreen mode Exit fullscreen mode
  • switch to the cloned folder. This can be done with Gitbash or the integrated terminal in the VSCode editor.
cd nameOfProject
Enter fullscreen mode Exit fullscreen mode
  • Make a new branch. Your name would make a good branch because it's unique.
 git checkout -b <name of new branch>
Enter fullscreen mode Exit fullscreen mode
  • Open the file that needs to be contributed to an example the README.md file
  • Make the necessary changes needed to be made lets take an instance of adding your name to the README.md file and next to it add the link to your github username page.

For example, -

Full Name https://github.com/your-username

  • Stage your changes
 git add README.md
Enter fullscreen mode Exit fullscreen mode

or

  git add .
Enter fullscreen mode Exit fullscreen mode
  • Commit the changes.
 git commit -m "Add <your-github-username>"
Enter fullscreen mode Exit fullscreen mode
  • Check the status of your repository.
git status
Enter fullscreen mode Exit fullscreen mode
  • Pushing your repository to GitHub.
 git push origin <name of your branch>
Enter fullscreen mode Exit fullscreen mode

or

 git branch -M main
 git push -u origin main
Enter fullscreen mode Exit fullscreen mode
  • Navigate to your fork, on the top of the files section you'll notice a new section containing, a contribute button!

  • Click on the contribute button, it will open a drop down, click the pull request button on the drop down.
    Note: A pull request allows your changes to be merged with the original project.

  • Wait for your changes to be merged.

Hurray! You successfully made a contribution! 🎉

And with surely these steps above and different alternatives, you can surely be able to make your first contribution. Happy Contributing indeed.

For more resources and information about contributing to open source using git and github, checkout this toturial Git and Github by Kunal Kushwaha

Feel free to connect with me on github and LinkedIn, thank you.

Discussion (2)

Collapse
seokjeon profile image
Se-ok Jeon

Thx for this! This is really what I wanted. Helped A LOT.
Can I translate in Korean this post? If you don't mind, I wanna share this awesome post in Korean. Surely, There will be a link directing to this original post.

Collapse
rukundob451 profile image
Benjamin Rukundo Author

Hello Se-ok Jeon, feel free to translate this post to Korean as I would be really glad to have a look it and know how it will look like.
I’ll be glad for the link directing to the original post, thank you.

I am super pumped for the Korean translation indeed. All the best.