You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Git LFS has no idea what remote was pulled from in the smudge command, so it defaults to origin. I don't think the post-checkout hook will help either:
For git pull we could use GIT_REFLOG_ACTION=pull <remote> <branch>, but that is not the case to solve, git checkout is.
Btw., it's not only about supporting multiple remotes, it's also about supporting repos with a single remote which is not named origin. Git LFS doesn't support that use case.
@technoweenie: I can't think of any tricks to help here, unless perhaps there happens to be some magic environment variable that gets set before calling the filter.
I can understand the inconvenience of trying to use LFS with a remote that is not called origin. But it is easy to configure around that problem, I would think?
But I'm having a little trouble understanding how LFS could possibly work with more than one remote at the same time. There are many contexts when the filters are run without any connection to a remote. For example, I can git checkout $SHA1. Git can't know where that SHA-1 came from so how can it possibly know which of multiple LFS servers it should use to fetch large objects?
I think LFS is by its nature limited to working with a single LFS server per repository.
@mhagger, @technoweenie maybe the solution isn't deciding which LFS remote is correct per Git remote but having a series of them, potentially, which allow fallback to get the binaries as needed. Since the files are named uniquely based on content hashes it doesn't matter which LFS remote the content is fetched from, so long as it is available.
Perhaps only supporting a single default LFS remote on push is correct, because I cannot see how anyone would want to push to multiple if they didn't need to.
I haven't tried it, but we shouldn't have problems with push, as we know which remote is being pushed to. git lfs pre-push and git lfs push require both a remote as argument.
I'm a bit confused here. Imagine the following use cases:
I want to store my repo on GitHub, but I want the large files to be stored on a local computer with ssh. This avoids having to rack up GitHub bandwidth costs, for example.
I want to store my repo on GitHub with some of the large files (e.g. demo data), but I want some other large files (e.g. proprietary data) to be stored on another remote.
Are these two use cases supported with the current git LFS?
Is the following workflow possible?
git lfs pulls from the GitHub remote, and then pulls from a second remote if it is available.
I want to store my repo on GitHub, but I want the large files to be stored on a local computer with ssh. This avoids having to rack up GitHub bandwidth costs, for example.
Yeah, but not easily. You'll have to maintain a fair amount of stuff (SSH, custom git-lfs-authenticate script, custom LFS server).
I want to store my repo on GitHub with some of the large files (e.g. demo data), but I want some other large files (e.g. proprietary data) to be stored on another remote.
That's possible, by being careful about what branches you push to which remotes. Seems like it'd be easy to mess up.
Activity
rubyist commentedon Jun 24, 2015
This is probably a bad idea, but I'll toss it out anyway. Wondering if it's possible to parse
.git/logs/HEAD(or whatever) from thepost-checkout:michael-k commentedon Jun 24, 2015
For
git pullwe could useGIT_REFLOG_ACTION=pull <remote> <branch>, but that is not the case to solve,git checkoutis.Btw., it's not only about supporting multiple remotes, it's also about supporting repos with a single remote which is not named origin. Git LFS doesn't support that use case.
mhagger commentedon Jun 25, 2015
@technoweenie: I can't think of any tricks to help here, unless perhaps there happens to be some magic environment variable that gets set before calling the filter.
I can understand the inconvenience of trying to use LFS with a remote that is not called
origin. But it is easy to configure around that problem, I would think?But I'm having a little trouble understanding how LFS could possibly work with more than one remote at the same time. There are many contexts when the filters are run without any connection to a remote. For example, I can
git checkout $SHA1. Git can't know where that SHA-1 came from so how can it possibly know which of multiple LFS servers it should use to fetch large objects?I think LFS is by its nature limited to working with a single LFS server per repository.
whoisj commentedon Jun 25, 2015
@mhagger, @technoweenie maybe the solution isn't deciding which LFS remote is correct per Git remote but having a series of them, potentially, which allow fallback to get the binaries as needed. Since the files are named uniquely based on content hashes it doesn't matter which LFS remote the content is fetched from, so long as it is available.
Perhaps only supporting a single default LFS remote on push is correct, because I cannot see how anyone would want to push to multiple if they didn't need to.
michael-k commentedon Jun 25, 2015
I haven't tried it, but we shouldn't have problems with push, as we know which remote is being pushed to.
git lfs pre-pushandgit lfs pushrequire both a remote as argument.gully commentedon Feb 25, 2016
I'm a bit confused here. Imagine the following use cases:
I want to store my repo on GitHub, but I want the large files to be stored on a local computer with ssh. This avoids having to rack up GitHub bandwidth costs, for example.
I want to store my repo on GitHub with some of the large files (e.g. demo data), but I want some other large files (e.g. proprietary data) to be stored on another remote.
Are these two use cases supported with the current git LFS?
Is the following workflow possible?
git lfs pulls from the GitHub remote, and then pulls from a second remote if it is available.
technoweenie commentedon Feb 25, 2016
Yeah, but not easily. You'll have to maintain a fair amount of stuff (SSH, custom
git-lfs-authenticatescript, custom LFS server).That's possible, by being careful about what branches you push to which remotes. Seems like it'd be easy to mess up.