I'm trying to set up something like this: a bare repo on my HDD drive and a clone of it on my SSD with lfs installed. I'm doing it like this:
First I set up a bare repo on my HDD:
mkdir git_lfs_test.git
cd git_lfs_test.git
git init --bare
And then on my SSD:
git clone D:/Git/git_lfs_test.git
cd git_lfs_test
git lfs install
git lfs track '*.png'
After doing this I open the cloned repo in GitKraken. I make the initial commit and then commit and push the .gitattributes file. Then I create a png file (which GitKraken recognises as a lfs file) and push it to the origin. It throws this error:
Remote "origin" does not support the LFS locking API. Consider disabling it with:
$ git config lfs.D:/Git/git_lfs_test.git/info/lfs.locksverify false
batch request: missing protocol: "D:/Git/git_lfs_test.git/info/lfs"
exit
After running the line of code it suggests I still get the same error.
I'm new to git so I'm probalby making some obvious mistake, but I can't figure out what it is.
Also I want to set up my lfs cache so it is on the HDD so any help on that would be great.
I have the same problem, and this is a partial solution.
Run a local dockerized lfs-server saving the data somewhere, e.g. /var/LFS/LOCAL/REPOSITORY/, change it as you like.
docker run -d --rm -v /var/LFS/LOCAL/REPOSITORY/:/lfs -p 9999:9999 -t fjukstad/lfs-server
Browse the management interface at http://127.0.0.1:9999/mgmt [admin/admin]
- Add a user and a password
In your git directory, add the lfs url (you might want to remove the user/password, but it will keep asking you):
git config lfs.url http://user:password@localhost:9999/
Problems:
- This is not a per-branch config. Be sure that it does not affect other branches (this is my case: other branches point to a different server, so I risk missing files on such server).
- Don't know how to add ssh keys. If you do, tell us.
- The docker container should run permanently.
来源:https://stackoverflow.com/questions/51295924/how-to-add-a-remote-to-a-repository-with-lfs