1

I have my own github account and there is a repo name "MyAwesomeProject" and it contains two branch in the repo. Branch names:

  • main
  • developer

And I also have a client's github account and there is a repo and it's name is "ClientProject" but it is totally empty repo and there is no branch in the "ClientProject".

So what I want to do is, when I commit code in my "MyAwesomeProject" repo's "developer" branch, then I have to push my "MyAwesomeProject" repo's "developer" branch to client's "ClientProject" repo's "developer" branch.

Please help me to find out best and convenient solution for it.

You can provide solution using git commands or can go through source-tree too.

Nimantha
  • 6,405
  • 6
  • 28
  • 69

1 Answers1

0

First, you can push to multiple repositories in one command, as detailed here.

git remote set-url --add --push origin git@bitbucket.org:ClientProject/repo.git

I would define a remote "all", then configure branch.development.pushremote to "all".

That way, only that branch would push automatically to your repository and the client one.

For the client one, you can use an SSH URL, provided your public key was added to the Client GitHub SSH keys.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250