Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git bundle support or an "offline" workflow? #1755

Closed
christian-korneck opened this issue Dec 10, 2016 · 14 comments
Closed

git bundle support or an "offline" workflow? #1755

christian-korneck opened this issue Dec 10, 2016 · 14 comments

Comments

@christian-korneck
Copy link

christian-korneck commented Dec 10, 2016

git bundle is a a great git functionality to bundle individual commits into a container file that can then be used to update a git repository that is located on a computer which cannot directly reach the originating repository or the repository manager (i.e. github.com). I use it regularly to "pull" github repositories from isolated computers that don't have Internet access.

However, these bundle files don't include files tracked in git-lfs.

Are there any workarounds to achieve the same with git-lfs?
Are there any plans to add git bundle support to git-lfs (i.e. something like git lfs bundle)?

@christian-korneck christian-korneck changed the title git bundle suppport or a "offline" workflow? git bundle suppport or an "offline" workflow? Dec 10, 2016
@ttaylorr
Copy link
Contributor

Adding a git lfs bundle command would certainly be possible, but isn't something that's immediately on our roadmap. As always, the core team would welcome and assist in reviewing a pull-request to add support.

@sschuberth sschuberth changed the title git bundle suppport or an "offline" workflow? git bundle support or an "offline" workflow? Dec 23, 2016
@ttaylorr
Copy link
Contributor

Hi, circling back on the above. It is still the case that we do not have immediate plans to work on something like this, and I would still be more than happy to help anyone who is interested and does have the time. For now, since this isn't actively on my radar (or anyone else on @git-lfs/core, from my knowledge), I am going to close this.

@christian-korneck
Copy link
Author

:-(

@zhengyongtao
Copy link

zhengyongtao commented Apr 29, 2020

I have the same needs, are there no plans to achieve them?

@dvdveer
Copy link
Contributor

dvdveer commented Apr 29, 2020

I use a shell script to workaround this issue. It basically creates a tar archive with all the changed LFS files between the commits you want to bundle. When you want to unbundle you should extract the tar file before running git pull.

I've created a gist of it here: https://gist.github.com/dvdveer/a47966db83af115e6200124f92e22761

@christian-korneck
Copy link
Author

@dvdveer thanks for sharing

@zhengyongtao
Copy link

I used a similar way to solve,but this way can only package the resources of the current branch. What should I do with the resources of other branches? @dvdveer

@dvdveer
Copy link
Contributor

dvdveer commented May 10, 2020

The script that I shared also works with other branches. The only condition is that the lfs objects are already downloaded in your local repository. I solve this by running git lfs fetch --all before running the script, but this may not be feasible if you have a large total size of LFS objects. Unfortunately, I do not know of a git-lfs command that downloads an lfs object when you have it's hash. As far as I know the git lfs fetch command only takes git commits as argument.

@ModischFabrications
Copy link

I agree with the previous posters that bundle support is a necessity for some workflows, in my case to work on a git repo over an airgap. Using a local remote on a usb-stick seems to be unsupported by lfs as well (#3078), is there any alternative that I didn't think of that could replace both?

The solution from @dvdveer is nice bandaid, but an "official" solution that is tested and can be used reliably would be much appreciated.

@bk2204
Copy link
Member

bk2204 commented Jan 21, 2021

Local repositories are indeed supported and have been since I believe 2.10.0. You can therefore create a flash drive (I'd pick UDF, not FAT or exFAT) and push a repository to that flash drive.

@n3mc
Copy link

n3mc commented Nov 11, 2021

@bk2204 Is there any info on how to create a local repositry using LFS? You mentioned above creating a flash drive and push the repository to this. Would it be possible to get steps on this process?

@christian-korneck
Copy link
Author

I assume that comment referred to this:
#3918

@n3mc
Copy link

n3mc commented Nov 11, 2021

I assume that comment referred to this: #3918

Thanks! I'm still not sure about the whole process - we are looking to create an offline bundle with a repository using LFS

Can't seem to find a comprehensive list of steps to recreate this

@bk2204
Copy link
Member

bk2204 commented Nov 15, 2021

The way to create a local LFS repository is simply git init --bare in the destination directory. Once you push into that repository with a local path or a file:/// URL, it will contain the proper LFS objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants