1

How can I sync Bitbucket branch with openshift:master ?

I develop on my local desktop and I push my work into a branch named bitbucket:uat. Each time I push on bitbucket:uat I need after to run : git push openshift uat:master

Is there a way to automatically push into openshift:master at the same time I push into bitbucket:uat ?

(I use Openshift v2)

EntrustName
  • 421
  • 6
  • 19

1 Answers1

1

In theory, you can push to multiple remotes, but since your remote branch name is different pre remote (and multiple branch.<remote>.push settings are probably not supported), an alias is the simplest approach.

[alias]
    pushall = "!f(){ git push bitbucket uat; git push openshift uat:master; };f"
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Good idea yes thanks. Is it better to create a hook in bitbucket to pull in openshift from bitbucket automatically ? – EntrustName Oct 28 '16 at 16:26
  • A hook in bitbucket means a webhook, which isn't trivial to setup. I would go with the alias first, to test it out. Then, yes, a webhook is possible. – VonC Oct 28 '16 at 16:28