How to pull from an origin and merger to a different one?

80 views Asked by At

I am following this Acquia tutorial "Using Acquia Cloud with a remote repository" to merge 2 origins together. Here I am using Acquia & Bitbucket.

So, my both remote origins look like,

  • origin - [sitename]@svn-[number].prod.hosting.acquia.com:[sitename].git
  • bitbucket - [email protected]:[username]/[repo].git

When I work on the codebase I do the following to push codes. This is valid only for my work terminal.

  • git add .
  • git commit -m "message"
  • git push origin develop && git push bitbucket develop

Now, the problem is that I have other developers too. So they only have access to bitbucket. So they will push the codes to bitbucket repository and it is me who has to get those updates in my local machine and push to acquia too for deployment.

So the question is how can I get update from bitbucket repository and push to acquia repository so both are in sync.

Please suggest.

2

There are 2 answers

0
nneonneo On BEST ANSWER

You can keep things in sync with a simple

git pull bitbucket
git push origin

This pulls the latest changes from one remote repository and applies them to the other.

0
David Deutsch On

If you are always adding files to bitbucket and origin at the same time, and nobody else is pushing to origin, then a merge should not be necessary. Just make it a habit to do a push to origin after every fetch/pull from bitbucket, and the two should stay in sync.