Git warehouse migration, including branches, logs, etc.

Preface

Originally, the project git repository was on the public network server, and then the project server was built inside the company, so the public network git repository was migrated back.

First, you need to create the corresponding project in the new git repository.

The following four commands are mainly used

git clone --mirror <URL to my OLD repo location>
cd <New directory where your OLD repo was cloned>
git remote set-url origin <URL to my NEW repo location>
git push -f origin

The actual implementation is as follows

Then change the local git address to the new address

git remote -v

git remote set-url origin <new repo location>

The actual operation is as follows. The previous git repository uses gitbucket, and the later uses gitlab, which has no effect on the migration.

Guess you like

Origin blog.csdn.net/bai_ye_/article/details/115115980