I have two remote repositories remoteA
and remoteB
(one is the mirror) of the other.
I commit one change to remoteA
and I also plan to make the same change to remoteB
.
I could just use below command to port the change from remoteA
to remoteB
:
git push remoteB COMMIT_HASH_FROM_REMOTEA:mainline
Another way is that I could use git cherry-pick
to pick COMMIT_HASH_FROM_REMOTEA
in a local branch tracking remoteB
branch and then push this commit.
I notice if I use the first approach, the commit id would be the same for both remotes. But for the second approach, the commit id are different.
Is git smart enough to figure out the different commit id are actually identical under the second approach? In other words, if I use the second approach to push the change to remoteB
, would this bring any troubles (eg: merge conflicts) for others also work on these two remotes since git somehow thinks these two remotes start to diverge?
Thank you.