1

I'd like to "clone" an open source application on github to configure it and make a modified version of it.

I figured the cloning and changing part tho I can't seem to figure out this. How can I clone the repo, but maintain a "relation" to the original one since it's still under development and many patches are pushed regularly. So how can I get the updates once they are available without saving my changes separately and re merge with every new version?

ps:my terminology is pretty limited when it comes to git, so please do correct me if i did mention anything wrong.

Nour
  • 777
  • 1
  • 8
  • 25
  • If I get you right, you are looking for [this][1]. [1]: http://stackoverflow.com/a/7244456/4832389 – Joe May 23 '15 at 14:09
  • Pretty sure you are asking about `rebase`: https://git-scm.com/book/en/v2/Git-Branching-Rebasing – William Pursell May 23 '15 at 14:12
  • @Joe , the link is very helpful it's closely related to what I am trying to do. Thanks! – Nour May 23 '15 at 14:18
  • @WilliamPursell I wasn't aware of the rebase concept. thank you for pointing it out, I think that is what I was looking for. i'll give it a try! just to clarify, i want to get the repo and any updates pushed to it after i's been copied, and maintain any changes made locally to it(ones i made after cloning) i hope this clears the picture of what i am trying to ask about ? – Nour May 23 '15 at 14:18

1 Answers1

0

In case anyone is facing the same issue, I found this link to be really helpful.

Here's a simple walkthrough:

  1. Fork the repo you are in need of. [Do so by clicking the fork button in the repository page.]
  2. make sure to Watch and Star the repo to get notified when any new updates pop up.[the watch and star button are also found in the repository page as well]
  3. clone the forked repo to you local machine, this is now your working directory.
  4. Now we want to setup a remote that will track the original repo

    git remote add upstream https://github.com/username/repositoryname.git
    

this will add a new remote called 'upstream' which points to the official Torque2D repository.

  1. now we need to create a new branch, naming it whatever you want, type in :

    git branch branch_name
    

we switch to the new branch with the checkout command, making 'branch_name' our currently active branch; we target the most recent version of the repository that is linked to our upstream remote and pull in the contents of its development branch into our currently active local branch.

for me this worked, the remote link was the missing piece of the puzzle, rebase was an epic feature someone pointed out in the comments section above which made life a bit easier when it comes to merging updates from different branches.

Nour
  • 777
  • 1
  • 8
  • 25