File: day_608__easier_git-lfs_setup.mdwn

package info (click to toggle)
git-annex 8.20210223-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 68,764 kB
  • sloc: haskell: 70,359; javascript: 9,103; sh: 1,304; makefile: 212; perl: 136; ansic: 44
file content (25 lines) | stat: -rw-r--r-- 1,177 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
The git-lfs support I added to git-annex had one small problem: People
expect to be able to clone a git repo and get right to using it, but after
cloning a git-annex repo that's on a server that uses git-lfs, there
was an extra `git annex enableremote` step to be able to use it as a git-lfs
special remote. And, you ended up with a "origin" git remote and a git-lfs
special remote with some other name.

Now, it's this simple to set up a git-lfs repo on eg, github:

	git annex initremote github type=git-lfs encryption=none url=https://github.com/joeyh/lfstest
	git annex sync github
	git annex copy --to github ...

And then for others to clone and use it is even simpler:

	git clone https://github.com/joeyh/lfstest
	cd lfstest
	git annex get

The only gotcha is that git-annex has to know the url that's used for
the remote. Cloning any other url any other way (eg http instead of https)
will result in git-annex not using it. This is a consequence of git-lfs
not having any equivilant of a git-annex repository UUID, so git-annex
can't probe for the UUID and has to compare urls. This can be worked
around using `initremote --sameas` to tell git-annex about other urls.