0

I forked a repo from an organization in github and made some changes locally and pushed them , the changes are reflected in my forked copy on my account but not the original copy on the organization account.

How can I compare these two repos locally and merge them together.

Assume I have access to the original repo.

ak94
  • 15
  • 1
  • 1
  • 5
  • This [answer](http://stackoverflow.com/a/28311094/1969198) describes how to merge an upstream branch into your local branch – AesSedai101 Feb 04 '15 at 09:44

1 Answers1

0

You should use remotes:

git remote add upstream https://path-to-original.repo

Note that the name upstream can be anything you like. After adding a remote, running git fetch upstream helps you:

Fetch branches and/or tags (collectively, "refs") from one or more other repositories, along with the objects necessary to complete their histories.

fetch is necessary if you for example don't have some branches of the upstream.

Now you can pull (assuming you are on the same branch) using:

git push upstream master

Now to compare your for example master with master of remote you would write something like this:

git diff master upstream/master

You could list all of your remotes using:

git remote -v
Community
  • 1
  • 1
Yan Foto
  • 10,850
  • 6
  • 57
  • 88