0

Maybe it seems a little bit like a dumb question, but a friend of mine has two repositories and he needs files to be pushed and pulled from/in each of the repositories to the other. Is there any way to do this with git?

Mihai Bujanca
  • 3,779
  • 9
  • 38
  • 80

2 Answers2

0

If the two repositories are located in the same system then it doesn't makes any sense as only one repository can be used. In case you are using one of them as a remote location then the IDE (NetBeans or Eclipse) will provide with the options for pulling from or pushing to these repositories.

  • They are both repositories hosted on heroku. Actually, it was quite a stupid idea of my friend: he made two separate apps and now wants to integrate them as he thinks they would work nice together – Mihai Bujanca Mar 14 '13 at 19:43
0

You cannot push "files", you can only push commits.

You can have a local repository with two remotes defined. Then you can pull from the one repository and push to the other.

But at the end you can only checkout a single commit, i.e. if both repositories are completely unrelated it is probably no good idea.

You should really think about what you want to achieve and why, before thinking about the how.

michas
  • 22,506
  • 9
  • 64
  • 105