Academy Omen
  • Tutorials
  • About

Academy Omen

Join us on a quest for excellence with our world-class tutorials. Elevate your software engineering skills and open new doors of opportunity.

About

GitHubX (Fomerly Twitter)Youtube Channel

Company

HomeAboutContact

Contact

+012 XXXXXXXXX

peng@traleor.com

Powered By Traleor CMS (& Wagtail)

How to Contribute to an Open-source project with GitHub | GitHub Fork & Pull Workflow for Beginners

Date Published: 2021-03-31

contribute with github
HomeTutorials
Peng

Peng Akebuon

Tutorial Summary

In this tutorial, we show you how to Contribute to an Open Source Project using GitHub. In general, we contribute to open-source projects following the fork-and-pull Git workflow

Start by Installing Git on your OS

# Code Snippet
# 1. Fork the repository to your own Github account
#
# 2. Clone the project to your machine
git clone https://github.com/<github-username>/<repo-name>.git
#
# 3. Add Upstream or the remote of the original project to your local repository
# check remotes
git remote -v
git remote add upstream https://github.com/<github-username>/<repo-name>.git
#
# 4. Make sure you update the local repository
# Get updates
git fetch upstream
# switch to master branch
git checkout master
# Merge updates to local repository
git merge upstream/master
# Push to github repository
git push origin master
#
# 5. Create a branch locally with a succinct but descriptive name
git checkout -b branch-name
#
# 6. Commit changes to the branch
# Stage changes for commit i.e add all modified files to commit
git add .
git commit -m "added git commands for "fork-and-pull" Git workflow"
# check status
git status
#
# 7. Following any formatting and testing guidelines specific to this repository
#
# 8. Push changes to your fork
git push origin branch-name
#
# 9. Open a PR in our repository and follow the PR template so that we can efficiently review the changes.
#
# 10. After the pull request was merged, fetch it and update the default branch of your fork
#
#### NB
1. Never Commit on the default branch, commit on branches then make a pull request
2. After making changes, if you want to make another change make sure you branch from the default branch because if you branch from branch-name, this will contain the changes from the 1st pull request except for the new pull request you working on requires the changes from the first pull request
```
# check present branch
git branch
# switch to master branch   
git checkout master
# create new branch for new changes
git checkout -b 2nd-test-branch
# make new changes and push to your fork
```
3. After the pull request was merged, fetch the upstream and update the default branch of your fork
####

Let's Connect

🔗 LinkedIn
🔗 Twitter
🔗 Join Our Discord Server

🔗 Academy Omen: GitHub

github

Related Tutorials

How to Build an AI Model with Tensorflow & Deploy with Django - Step by Step Guide

How to Build an AI Model with Tensorflow & Deploy with Django - Step by Step Guide

Intermediate

2022-06-21

In this tutorial, we will show you how to train an AI model to predict image classes an...

How to Build a Blog with Powerful Rich-text Editor | Django  Step by Step Tutorial

How to Build a Blog with Powerful Rich-text Editor | Django Step by Step Tutorial

Beginner

2021-04-24

In this tutorial series, we build a blog with Django that has a Powerful Rich-text Edit...

How to Build a Software as a Service with Django

How to Build a Software as a Service with Django

Intermediate

2021-07-05

A comprehensive, step-by-step guide aimed at beginners, covering the creation of a Soft...