Follow the directions at https://git-lfs.github.com/, should simply be running
git lfs install
after installing the command line extension.
- Add regular files, git lfs tracked files as usual.
- Add an
.lsconfig
entry for the gitlab lfs url. Replaceuser
andrepo
with your values respectively.git config -f .lfsconfig lfs.url https://gitlab.com/user/repo/info/lfs
- Create a new GitLab project
- Add the GitLab project as a gitlab remote
git remote add gitlab git@gitlab.com:user/repo.git
- Push to the gitlab remote first, to setup git lfs there.
git push gitlab master
- Create a new GitHub project.
- add it as
origin
remote.git remote add origin git@gitlab.com:user/repo.git
- STOP, before pushing to GitHub you need to do one of two things. If your GitLab account is authenticated by a simple password you should be prepared to enter that. Otherwise you need to create a personal access token with api (read/write) access to use as a password for the upcoming step.
- Push to the GitHub remote, this will then prompt you for a username and password. This is your GitLab username and password / PAT generated in the last step.
git push gitlab master
Username: user Password: xyz1234 - Interact with GitHub normally from here on out! You can optionally set the GitLab to mirror the GitHub project from this point at https://gitlab.com/jimhester/test-glfs/settings/repository.
- Track the files with git lfs tracked files you want to use.
- Add an
.lsconfig
entry for the gitlab lfs url. Replaceuser
andrepo
with your values respectively.git config -f .lfsconfig lfs.url https://gitlab.com/user/repo/info/lfs
- Import your GitHub project to GitLab, (do not set up mirroring initially).
- Add the GitLab project as a gitlab remote
git remote add gitlab git@gitlab.com:user/repo.git
- Push to the gitlab remote, to setup git lfs there.
git push gitlab master
- STOP, before pushing to GitHub you need to do one of two things. If your GitLab account is authenticated by a simple password you should be prepared to enter that. Otherwise you need to create a personal access token with api (read/write) access to use as a password for the upcoming step.
- Push to the GitHub remote, this will then prompt you for a username and password. This is your GitLab username and password / PAT generated in the last step.
git push gitlab master
Username: user Password: xyz1234 - Interact with GitHub normally from here on out! You can optionally set the GitLab to mirror the GitHub project from this point at https://gitlab.com/jimhester/test-glfs/settings/repository.