Contribute To Open Source — Keep Your Forked Repo Update To Date And In Synced

Contribute to Open Source

  1. Source Repo/Upstream Repo (where the main project is contributed to)
  2. Forked Repo/Origin Repo (a copy from the source to on your Github account)
  3. Clone Repo/Local Repo (a copy from your Github to your local PC)

There are 2 ways to keep your forked/origin repo update to date with the latest changes from the source repo.

UI Approach

  1. On your Github forked repo. Click on the Fetch upstream.
  2. Click Fetch and merge

3. Now your forked/origin repo is update to date with the source repo.

4. On your local repo main branch do a git pull to get the latest changes from your origin repo.

5. Now switch over to your feature branch git checkout <your branch name>

6. Do a git merge main to get the latest changes into your branch from the main branch.

6. Now the upstream, the origin, and the local repo are all in sync with the latest changes.

CLI Approach

  1. Add the source/upstream repo to your local repo. git remote add upstream <The Source Github URL/SSH>

2. Now your local repo you will now have a remote origin and a remote upstream.

3. In your local repo main branch or feature branch do a git pull upstream main to pull the latest changes from the source/upstream repo into your local repo.

4. Do a git push -u origin main(or feature_branch)(first time only) or git push to push the latest changes from your local repo into your forked/origin repo.

5. If you push up the feature branch. On your forked repo, do a Pull Request to merge it into your origin main.

Ready to Make the Contribution to the Open Source Repo.

  1. After pushing the feature branch onto your forked/origin repo. In your Github account go to the feature branch that you want to contribute.

2. Click on the branches next to master.

3. On the branches page. Find the branch that you want to contribute and click on the New pull request button.

4. base repo [source repo] base [main] ← head repo [origin repo] compare [feature branch]

5. Submit

--

--

--

Copy and Paste what’s on my mind. Perfect.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Google Cloud Professional Data Engineer — Roadmap for preparation

What I Learnt About Effective Use of Analytics

Front-end Web Development — Roadmap Decoded!

How I got started with OpenMRS?

6 Must-Know Methods in Python’s Random Module

GO — The TESLA Of Programming World

Window Aggregations made easy in PySpark

Back to the Future! From C++ to Angular

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dong Xia

Dong Xia

Copy and Paste what’s on my mind. Perfect.

More from Medium

73. Set Matrix Zeroes

INDEPENDENT POWER PRODUCERS

A chat with TezosThugs

Keepin Hope (and Hardware) Alive… Unofficially