Configure Gerrit with Git LFS examples please
Asked Answered
H

1

7

Could someone please provide examples of how you configured Gerrit to work with Git LFS? I understand that $GERRIT_SITE/etc/gerrit.config must be modified (I'd appreciate a good example here).

On top of that, I think that each project (Git repo) requires configuration, but I'm not sure if that is done through the command line or via entries in other configuration files.

Thanks in advance.

Hamo answered 1/11, 2018 at 13:44 Comment(0)
S
5

1) Install Plugin

2) Configure GERRIT-SITE/etc/lfs.config

[storage]
    backend = fs
    directory = xxxxx <= Default: $GERRIT_SITE/data/lfs

3) Configure GERRIT-SITE/etc/gerrit.config

[lfs] plugin = lfs

4) Configure all-projects

git clone https://USER@GERRIT-SERVER/a/All-Projects
git fetch origin refs/meta/config
git checkout FETCH_HEAD
vi lfs.config

[lfs "^.*"]
    enabled = true
    maxObjectSize = 50m

git commit -a
git push origin HEAD:refs/meta/config
Sachiko answered 1/11, 2018 at 14:20 Comment(6)
I will try what you have shared. Thank you.Hamo
Do you have any tips for trouble-shooting? I had to ask the Gerrit admin to perform these steps. Although 'git lfs track' shows the desired patterns (e.g., '*.exe'), after committing a new .exe, nothing shows up when I issue 'git lfs ls-files'.Hamo
Have you pushed and merged (submitted in Gerrit) the change? The files won't show up in "git lfs ls-files" command until they're integrated in the branch.Pelota
Yes. I've added a binary from one local repo and pushed that change. Pulled that change into a second local repo. Still, git lfs ls-files comes up empty.Hamo
Check if Git-Lfs is correctly configurated at the local machine and then ask to the Gerrit admin to check for error in the GERRIT-SITE/logs/error_log file.Pelota
Gracias Marcelo. The Gerrit admin found no errors in the log. I believe that the local machine is configured correctly, the commands such as 'git lfs ls-files', although it comes back empty, seem to work.Hamo

© 2022 - 2024 — McMap. All rights reserved.