user11958027
user11958027

Reputation: 15

Git push changes from 1 remote to another

So I have 2 repos right now, A:B where A is the remote origin name, B is the branch name, and C:D where C is the second remote origin name, D is the branch name.

I do work on A:B, so that includes PRs, etc. Once the work is done, A:B will contain the latest version of the code I want. Now I want to push the changes from A:B to C:D. Is this how I would do it?

git remote add crepo C_GIT_URL
git push crepo B:D

Would that push all the changes from B branch in A repo to D branch in C repo?

Upvotes: 0

Views: 39

Answers (1)

Ben
Ben

Reputation: 1367

As your question is written, yes that will do what you expect.

To reiterate:
git push <remote> B:D will update the <remote> branch D with the changes made to the local branch B

Upvotes: 1

Related Questions