git-lfs implementation for Gitolite.
I currently do not use this software and I do not update it...:cry:
Please consider using other software if possible.(GitBucket/Gogs(Gitea)/GitLab)
Assumption
- Install to /var/www/git
- Gitolite has been installed in the /var/git
- Repository is located in /var/git/repositories
- gitolite-shell is located in /var/git/bin
- Install the Gitolite.(This is not described here.)
- Clone this project.
git clone https://github.com/HimaJyun/gitolite-lfs
- Add permission.
sudo chmod +x -R gitolite-lfs/src/
- Move the src/*
sudo mv gitolite-lfs/src/* /var/www/git/
- Please set.
gitolite-lfs.sh
# Gitolite home path.
export GITOLITE_HTTP_HOME="/var/git"
# Gitolite repository path.
export GIT_PROJECT_ROOT="${GITOLITE_HTTP_HOME}/repositories"
# Always 1;
export GIT_HTTP_EXPORT_ALL=1
lfs/config.pl
our %config = (
# Gitolite home path.
GITOLITE_HOME => "$ENV{GIT_PROJECT_ROOT}/..",
# Gitolite bin path.
GITOLITE_BIN => "$ENV{GIT_PROJECT_ROOT}/../bin",
# Gitolite lib path.
GITOLITE_LIB => "$ENV{GIT_PROJECT_ROOT}/../bin/lib",
# lfs repo path.
REPO_DIR => "$ENV{GIT_PROJECT_ROOT}/../lfs",
# git-lfs up/download buffer size.
UPLOAD_BUFFER_SIZE => 1024,
DOWNLOAD_BUFFER_SIZE => 1024,
# Use X-Sendfile(or X-Accel-Redirect)
#X_SENDFILE => "X-Sendfile",
# Nginx only.
#NGX_ACCEL_PATH => "lfsdownload",
);
Configuring the Web server.
Apache -> docs/Apache/README.md
Nginx -> docs/Nginx/README.md
- Open .gitolite.rc
sudo editor /var/git/.gitolite.rc
- Add [LFS_URL]
LFS_URL => "http://example.com/",
- Uncomment [LOCAL_CODE]
LOCAL_CODE => "$rc{GL_ADMIN_BASE}/local",
- Add the [git-lfs-authenticate] to [ENABLE]
ENABLE => [
'git-lfs-authenticate',
]
In your PC
- Clone the gitolite-admin repo.
git clone ssh://example.com/gitolite-admin.git;cd gitolite-admin
- Create local/commands
mkdir -p local/commands
- Place the git-lfs-authenticate
curl -o local/commands/git-lfs-authenticate https://raw.githubusercontent.com/HimaJyun/gitolite-lfs/master/commands/git-lfs-authenticate
- Commit and push
git add local/commands/git-lfs-authenticate
git config core.filemode false
git update-index --add --chmod=+x local/commands/git-lfs-authenticate
git commit -am "Add git-lfs-authenticate command."
git push origin master