I have two repositories: project.git which has been the main repository for our project, then we started another empty git repository called newproject.git we pulled out pieces and parts of code that can be reused from project.git and used in the code base in newproject.git.
My question is: is there a way to merge newproject.git back into project.git such that, the history/commits are appended together, as if newproject.git never exited. BUT all the files in newproject.git will replace the contents in project.git?
Thanks
You can add your newproject.git repository to the project.git as another remote. And you have two remote repositories: origin and newproject.
git remote add newproject newproject.git
or set other options (like -m)
git help remote
You can pull from origin/newproject
git pull origin
or
git pull newproject
and you just have to merge to your origin master and push to origin (project.git).
git push origin master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With