First Open-Source Contribution(First Commit in Open-Source Projects)

Dheeraj JhaDheeraj Jha
3 min read

What is Open-Source Contribution?

Open-Source Contribution involves contributing to the development of open-source software. It helps us understand the codes of different organizations, work on real-world projects, and contribute to these projects.

What does "commit" mean in open-source contribution?

In open-source contribution, we can say a commit is adding some features or changes to the project, like adding features, resolving bugs, etc. These commits help organizations improve their features and remove bugs, etc.

Steps for First Contribution in Other Repositories

  1. Fork the desired repository. I have to contribute to the js-hindi repository, so I forked the js-hindi repository first, then entered Create Fork.

  2. Then create a folder for the repository you want to contribute to.

  3. Open the terminal/command prompt(If you are using windows) and type git clone for cloning the repository (git clone "the link of the repository which is a fork").

  4. cd Repository name

  5. Make the changes in other repositories as you want to change.

  6. Type these commands in the repository as mentioned below.

Why are these commands used to commit?

git clone-

A git clone is primarily used to point to an existing repository and make a clone or copy of that repository in a new directory at another location.

cd -

To change this current working directory.

git remote add upstream -

We use git remote add upstream to specify the remote repository from which we want to pull changes or updates ("git remote add upstream "remote repository link from which you want to pull changes").

git remote -

We use 'git remote' to manage the remote repositories associated with our local Git repository.

git pull upstream main -

We use git pull upstream main to fetch and merge changes from the upstream repository's main branch into our local repository's current branch.

git checkout -b -

We use 'git checkout -b' to create a new branch and switch to it at the same time(git checkout -b "New branch name").

git branch -a -

We use 'git branch -a' to list all the branches in our local repository as well as the remote repositories that are currently available.

git add .-

We use 'git add .' to stage all changes in the current directory and its subdirectories for the next commit.

git commit -m-

We use 'git commit -m' to create a new commit with a message that describes the changes we've made(git commit -m "Write the message for the author about what you had changed in the repository").

git remote -v-

We use 'git remote -v' to display a list of all the remote repositories that are currently associated with our local Git repository.

git push -u origin-

We use 'git push -u origin' to push our local changes to the origin remote repository and set it as the default upstream branch for the current branch(git push -u origin "the new branch name that you created").

Compare and Pull request

Enter the compare & pull request.

Create Pull request

Leave a comment and then enter Create pull request, and your first pull request is generated. Now the author will check the changes you made, and if he finds them correct, he will accept your pull request; if they don't find them correct, they will suggest that you make the changes in your commit.

Conclusion

The initiative matters the most. The first step is to contribute, which helps you to gain more knowledge in your field. The open-source contribution helps you build connections with people who are contributing to the projects and who have good knowledge in the field where you want to learn.

1
Subscribe to my newsletter

Read articles from Dheeraj Jha directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Dheeraj Jha
Dheeraj Jha

I am very passionate about coding and development and I like working on real-world projects. I am enthusiastic about technology and always impressed by the change it brings to the world. Some skills consist of Data Structures and Algorithms (Java), Web Development. I worked on Front-end Technologies (HTML5, CSS3, Bootstrap, Javascript, ReactJS, Tailwind CSS) and Backend Technologies (MongoDB and NodeJS) for almost a year and completed a number of projects. I have been involved in open-source projects related to web development and data structures and algorithms (Java). Aspire to a stimulating career in web development to use my acquired skills and experience to achieve the best result. In addition to this love of nature and learning is constant.