将提交从一个存储库推入另一个存储库 [英] Pushing a commit from one repository into another repository
问题描述
是否有可能将一个提交从一个Git存储库推送到另一个 Git存储库的分支中?
例如,我在Repository A中提交了一个commit aaaa
。Commit aaaa
位于名为Testing的分支中。我想将commit aaaa
推送到名为Stable的分支中,该分支位于另一个名为Repository B的存储库中。当从A推入到Repository B时,Repository B的新提交应作为提交 aaaa
的确切映像,即将存储库B中的分支Stable中的所有文件替换为A中的文件。
如果可能,我该怎么做? 试试这个:
git push repositoryb aaaa:Stable
我假设 repositoryb
是远程指向其他仓库的仓库。如果你还没有掌握git,上面的提交将提交到 aaaa
,而不仅仅是 aaaa
。
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?
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
.
这篇关于将提交从一个存储库推入另一个存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!