0

There is an existing Open Source Project, say A, on GitHub which I have cloned. I have some requirements which will need modifying some of the features of this Open Source Project. So, I was thinking of creating a new Git Repository with the latest code of A and commit all my changes to this new repository, say B.

However, if there are any new changes in A, I would like to merge them with my project B. (I don't want to commit my changes to A).

I have never used GitHub (only used SVN). What is the best way of doing this?

mridula
  • 3,203
  • 3
  • 32
  • 55
  • You can fork latest code from repo A and create your own repo with your credentials then create a new branch. You can commit your code changes to your repo B's new branch. – ManojP Feb 03 '15 at 07:55
  • you can take help from below link http://stackoverflow.com/questions/7244321/how-to-update-github-forked-repository – ManojP Feb 03 '15 at 07:58

1 Answers1

0

What you need is called a remote. After you have forked the project and cloned it locally, you can just add the original as a remote by using:

git remote add myremote https://github.com/user/original_repo

After that you can pull from that remote by running

git pull myremote master

You can of course pull also any branch other than master. Pushing is similar.

You can also see a list of all remotes by one of the following commands:

git remote show
git remote -v

The full documentation can be found here and a great tutorial is here

Yan Foto
  • 10,850
  • 6
  • 57
  • 88