My group was collaborating with another group on a project, and we set up a GitHub organization for the collaboration. Now that the collaboration ended, we are about to delete the organization from GitHub, and I need to make a local copy of the repositories my team worked on.
My understanding is that git clone --bare <url>
is a good way to do this, but some of these repos use LFS. I was hoping I could follow the instructions here, except instead of pushing to a new remote, clone the bare repository locally. In other words, I wanted to do this:
git clone --bare [email protected]:<organization>/somerepo.git
cd somerepo.git/
git lfs fetch --all
cd ..
git clone somerepo.git/
cd somerepo
# View source code, build, checkout other branches, etc.
and I was hoping LFS would fetch from the bare repo directly. Unfortunately, as I was afraid, it doesn't seem to work that way.
Is there a way to accomplish that, or otherwise obtain a local working copy of a repository--with local copies of all the branches and tags and all the large files? If it matters, we don't need to be able to add new commits, just checkout different branches and access all the files.
With Git LFS 2.9.0, it's possible to clone from a local repository if you specify it as an absolute file URL. Local paths are not supported, but they will be in Git LFS 2.10.0.
In addition, you currently need to use %3a
instead of a colon if you're on Windows. You're not, but other folks are, and it's a common source of issues. This requirement should also go away in 2.10.0.
So essentially, the URL that you use to clone with Git should look something like the following: file:///home/nick/checkouts/somerepo.git
.