Practical Collaborative Strategy for teams and open source enthusiasts with GIT

Practical Collaborative Strategy for teams and open source enthusiasts with GIT

INTRODUCTION

Collaboration is the next big thing, yes I said it. 💡

Enough with the long and boring explanations about Git and Github. Using a short case study, we're going over the most practical and common cooperation tactics in corporations and the IT industry today.

Case study:

We are building a name biography website and guess what, you and everyone else can contribute hence let’s call it an open source project.

For a start, I had set up the project online repository on GitHub with the simple steps below:

  • login into github.com, create an account if you do not have one already.
  • Navigate to repository tab and click the create new, the repository is made public as its going to be an open source project for all and added basic project setup.

Repo Link

I want to develop something this large, and I'm looking forward to having that you, from wherever you're reading this, will assist me in doing so by collaborating with me. When working on a team project, this is the same procedure. Isn't it thrilling?

So shall we?

Some projects for organizations or open source have GitHub issues created by the project maintainer (or someone with the appropriate permissions), while others do not. It's ideal if you make one on the topic of your contribution. These problems provide contributors with instructions on how to work on a project and what they should do.

In our case, you will be creating yours

So where do you find these issues ?

Issue tab.png

kindly navigate to the issues tab after clicking the link for our project above (or your teams project as the case maybe). Seen a lot of issues with different tag, Right? How it was created ? it is simple actually, the project maintainer (i.e me of course) just did the following

  • Go to the issue tab
  • Click Create new issue
  • Add the issue title as 'Added my bio detail'
  • At the Left corner, select Label as 'good first issue'

Now, let's get back to you collaborating on this fantastic project. After identifying the issue you want to tackle (okay, here's where you add your bio), let's get down to brass tacks..

COLLABORATION STRATEGY

This entails four basic steps, which when mastered provide you with the ultimate superpower in effective collaboration.

1. You will need to fork the repository,

Click Here

WHAT DO YOU MEAN FORK THE REPOSITORY, Relax, let me explain,

This is to create your copy on the project to your github account for more flexibility. To fork a repo, click the fork button at the top right corner of the github website of the repo.

fork.PNG

2. You need to clone the project to your local computer,

In simple explanation, cloning is creating a copy of the code online to your local computer so you can work from there.

To clone a repo to your local computer ,

  • Click the code tab on the forked project on your github and them click the copy code icon as show below:

clone.png

  • Now let’s go to your local computer,
  • Open favorite code editor (mine is Vscode ) , open the inbuilt terminal and paste the code you copied after a 'git clone' command to clone this project repository to your local computer as shown below :-
git clone <your-copy-code>
  • Now on your terminal, move to the generated project folder with the code below;
cd OSS-Contribution-Beginer

This is getting exciting;

You've successfully cloned the online project with everyone else's codes to your repository and may now submit your own. I know you're eager to get started. However, always keep an eye out for files named contribution.md and/or README.md. It comprises language describing what the project maintainer wants you to contribute and how you should do it. Their standards, as well as everything else, are constantly present. (You can go over it quickly.)

Have you completed that task? The next important step is to create your GIT BRANCH on your local computer and move to it before you start writing code to fix the issue(s) you wish to solve.

What’s and why you need to create one ? > A branch allows you to make changes without affecting the main branch. it is always good to create your branch when contributing to projects.

So how you do this, simple write the following codes

git branch ‘name-of-the-branch-you-want

e.g git branch caesar-name

Let’s move to the just created branch

git checkout caesar-name

Guess what , It is time, you can now start solving that issue,

Make changes to the repository

In this scenario, our problem is to change the README.md to include your name, social media handler, and preferred emoji (browse how to get a markdown emoji)

  • Scroll to the bottom of the README.md, Add your name, social handlers and emoji to the list

Are you finished with that problem yet? , now let's ADD and COMMIT our code before PUSHING it to our online repository for the project maintainer to examine.

git add .

Then commit

git commit –m “added my name bio”

3. Push it online

All we have done so far, has been on your local computer or repository , now it's time to push it to the original online repository or computer on Github

With the few line of code below, this is accomplished

git push origin –u ‘your branch name’
i.e
git push origin –u caesar-name

4. Now is the BIG MOMENT 👍

It is time to create your first PR (Pull request) - You should remember that you made your own branch to avoid conflict with the main branch. Now that you've created a pull request for your latest changes, the repo maintainer will review them and merge them with the main branch if your contribution meets the issue's requirements.

  • Go to your forked repository in your browser, click compare and pull then click create pull request button.

Hurray! Congratulations. 🔥💡 You've successfully made your first open source contribution.

Some open source projects

Below are some other beginner-friendly open source projects you can start your journey with and contribute :

Thanks for Reading!!!

Leave a comment 💡 Like 👍 Share ⚡