If I have 2 Git repository such as PersonA, PersonB git repository.
If I make the branch ‘demo’ in PersonB repository, Also PersonA have commit a lot of their works for over six month. However, I want to push this branch (PersonB/demo) to be a (PersonA/demo), what should I do?
It is complicate that I don’t want to make a fast-forward when move to PersonA/demo.
I would like everything in PersonA/demo are the same place as PersonB/demo do.
Ex.
I make a demo for the product A when it was version 1.00 by clone to new repository seperate from the original, Now, the product A move to version 2.00, but I not have a time to maintain demo yet. So I would like to keep everything like the past but now, I would like to keep it together in the same repository.
From within the PersonB repo (assuming it has a remote named PersonA):
This will create the
demobranch in PersonA’s repo and point it to the same thing PersonB’s demo branch points to, without affecting anything else in PersonA’s repo.If you’d rather run a command from PersonA’s repo, then do the reverse:
which will create the
demobranch locally based off of the remotedemobranch.