0

I am new to managing repositories with bitbucket and am accessing it via sourcetree.

I have created a private bitbucket repository to provide a number of users a place to store and share code (primarily python/IDL). A number of members use Google Earth engine (via the online interface) and the goal is for their code to be available to others, alongside everyone else's code in the same repository.

Earth Engine provides a URL to clone your online code database and I have managed to do this, creating a new separate repository. I added it as a submodule to the group repository, but I cannot see this code on bitbucket. The submodule allows me to edit/push/pull the code with Sourcetree to Earth engine, but I would like this code (and changes) to be available on the group repository. I would like to streamline it so that any changes made in an individuals earth engine environment can be pulled into the group repository.

Is it possible to merge these repositories so they can all be managed from one place, even though one directs to bitbucket and one directs to google?

GeoMonkey
  • 1,615
  • 7
  • 28
  • 56
  • 1
    Possible duplicate of [pull/push from multiple remote locations](https://stackoverflow.com/questions/849308/pull-push-from-multiple-remote-locations) – Adrian J. Moreno May 23 '18 at 15:06
  • I tried this but got the following when trying to push: hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. I tried to pull but it says everything is already up to date – GeoMonkey May 23 '18 at 15:36

1 Answers1

0

From this answer on a related question:

git remote set-url origin --push --add <a remote>
git remote set-url origin --push --add <another remote>

So you can then do a single git push origin that pushes to both repos.

Adrian J. Moreno
  • 14,350
  • 1
  • 37
  • 44