The tool can be found here.
https://github.com/bozaro/git-lfs-migrate/releases
I recommend to migrate an existing repo to a new repo with lfs support activated and delte the old one afterwards.
Java8 needed check with:
java -version
check for the line
java version "1.8.0_111"
Check for latest version at: https://github.com/bozaro/git-lfs-migrate/releases It was 0.2.4 when I was using it
cd ~
wget https://github.com/bozaro/git-lfs-migrate/releases/download/0.2.4/git-lfs-migrate.zip
unzip git-lfs-migrate.zip -d git-lfs-migrate
Now we have the git-lfs-migrate tool installed under the users home directory: ~/git-lfs-migrate/
To get lfs working, make sure you activate lfs support in your repo. In this example this would be: git@github.com:example/example-converted.git
Clone the repo you want to migrate with following git command. Replace the url with the one of repository you want to migrate.
ATTENTION: This can take a while, grab some coffee on large repos :)
git clone --mirror git@github.com:example/example.git
java -jar ~/git-lfs-migrate/git-lfs-migrate.jar \
-s example.git \
-d example.git-converted.git \
-g git@github.com:example/example-converted.git \
"*.rpm" \
"*.jar"
The parameters are the following:
- -s is the source repo
- -d is the destination repo
- -g is the url to the lfs git repo / you can add the origin later and leave this parameter out.
- *.rpm and *.jar are added to the .gitattributes as files to handle with the lfs
To get a full list of parameters call the following command:
java -jar ~/git-lfs-migrate/git-lfs-migrate.jar --help
git push --mirror git@github.com:example/example-converted.git
Done :)