... | ... | @@ -63,6 +63,17 @@ git remote add origin git@gitlab.inria.fr:<gitlab_user>/<gitlab_project>.git |
|
|
git push --set-upstream origin master
|
|
|
```
|
|
|
|
|
|
This directory can then be used to work from now on, or if you want to be sure that everything is correct, you can try a new checkout from scratch from the gitlab in another directory:
|
|
|
|
|
|
```
|
|
|
cd ..
|
|
|
mv <forge_project> <forge_project>.migration
|
|
|
# (may be removed later when you're sure the migration was correct
|
|
|
git clone git@gitlab.inria.fr:<gitlab_user>/<gitlab_project>.git
|
|
|
cd <gitlab_project>
|
|
|
# check that all is correct
|
|
|
```
|
|
|
|
|
|
#### From Git
|
|
|
|
|
|
A convenient way to migrate everything (all branches, all tags) in a single operation is to use a mirror checkout:
|
... | ... | @@ -73,6 +84,17 @@ cd <forge_project>.git |
|
|
git push --mirror git@gitlab.inria.fr:<gitlab_user>/<gitlab_project>.git
|
|
|
```
|
|
|
|
|
|
This directory cannot be used as a local working copy since the --mirror option implies --bare. You need to checkout a new working copy:
|
|
|
|
|
|
```
|
|
|
cd ..
|
|
|
mv <forge_project>.git <forge_project>.git.migration
|
|
|
# (may be removed later when you're sure the migration was correct
|
|
|
git clone git@gitlab.inria.fr:<gitlab_user>/<gitlab_project>.git
|
|
|
cd <gitlab_project>
|
|
|
# check that all is correct
|
|
|
```
|
|
|
|
|
|
#### Filtering history
|
|
|
|
|
|
If needed, you can filter out part of the history before pushing it to the new gitlab git repository, with tools such as [git-filter-repo](https://github.com/newren/git-filter-repo), [bfg-ish](https://github.com/newren/git-filter-repo/blob/master/contrib/filter-repo-demos/bfg-ish), [BFG Repo Cleaner](https://rtyley.github.io/bfg-repo-cleaner/).
|
... | ... | |