1

I took code from an open source repo (openRepo) on github using the import repo tool. This imported the code to my private repo called RepoA and included all branches and tags. I want to do two things:

Problem 1: I want repoA to be updated by fresh code from openRepo. All new branches and tags should also be updated.

So i linked repoA to openRepo:

 git remote add public https://github.com/openRepo/A.git
 git pull public master
 git push origin master

This works but it only updates the master branch. It does not pick up new branches.

Problem 2: I wanted to make custom changes to RepoA, so I picked the latest_stable_branch from RepoA and made a new branch called devbranch in RepoA. I then added some code to it. At this moment, devbranch in RepoA is ahead of latest_stable_branch in RepoA and OpenRepo (since both are the same).

The problem is when OpenRepo releases another stable branch, I want that code plus the code from my devbranch. And i dont know how to do this.

Umair
  • 317
  • 1
  • 3
  • 9
  • If we know what you're doing this for, we can provide a better solution. Git is often pressed into roles, like backups and mirroring, that there are better tools for. – Schwern Feb 22 '19 at 19:33
  • 1
    Possible duplicate of [Set up git to pull and push all branches](https://stackoverflow.com/questions/1914579/set-up-git-to-pull-and-push-all-branches) – phd Feb 22 '19 at 20:09
  • https://stackoverflow.com/search?q=%5Bgit%5D+pull+push+all+branches – phd Feb 22 '19 at 20:09
  • @Schwern: I took code from an open source repo using the github import tool. This imported all branches and tags. I then created a dev branch where I am doing my own changes to this code. I want this repo to be updated with changes from the open source repo as well as keeping my branch updated with fresh code from stable branches. I hope this explanation makes more sense. – Umair Feb 22 '19 at 22:42
  • @phd no this doesnt help, since the articles talk about only origin branches. I need to transfer changes from public to origin branch – Umair Feb 22 '19 at 22:50
  • @Umair Which open source repository? – Schwern Feb 22 '19 at 23:16

0 Answers0