Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pushing a commit from one repository into another repository

Tags:

git

Is it possible for me to push a commit from one Git repository into a branch of another Git repository?

So for example, I have a commit aaaa in Repository A. Commit aaaa is in a branch called "Testing". I want to push commit aaaa into a branch called "Stable" which is in another repository called Repository B. When pushed into Repository B from A, the new commit to Repository B should be an exact image of commit aaaa, ie, replacing all of the files in the branch "Stable" in Repository B with the ones from A.

If this is possible, how can I do it?

like image 475
Carven Avatar asked Mar 25 '13 13:03

Carven


1 Answers

Try this:

git push repositoryb aaaa:Stable

I am assuming repositoryb is a remote pointing to the other repo. And if you haven't come to grips with git, the above pushes the commits upto aaaa and not just aaaa.

like image 142
manojlds Avatar answered Sep 26 '22 00:09

manojlds