How to push all the historical commit of the git project to the new warehouse

if you use git push, only the latest commit,
will not be uploaded before commit.

Feb.28,2021

push contains all commit, since the last push by default. You can see it by using git log.


cd /path/to/your/git/repo/
git remote -v
// repo
git remote rm origin
// repo
git remote add origin ssh://username@xxx.xxx.xxx/new/repo
git push -u origin --all
git push -u origin --tags

personal test can be

When

pull, the URL address is changed to the new warehouse address.


Don't guess, who told you that git push can only push one commit record? Try it for yourself. There are surprises


http://blog.dennisrobinson.na.

normally, there is more than one current commit record

Menu