How git uploads local old projects to the new repository but does not upload log records

I want to upload one of my projects to a new repository, but I don’t want to upload the log records to the new repository, that is, the new repository records from scratch, the old one or keep the original, and the log of subsequent changes can be the same.

Delete the .git directory for this project
Execute git init
Execute git remote add origin {new repository link}
Execute git add.; git commit -m “first commit”; git push -u origin –all
There is no way for Git to commit the same subsequent commits of the old and new repositories, unless you manually maintain two projects at the same time, make the same changes, and make the same commits.

Or you can write a script that automatically synchronizes the changes to another project after changes in one project, and then the two projects do the same commit.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *