written by Nick Shin - [email protected]
this code found in this file is licensed under: Unlicense - http://unlicense.org/
and, is from - https://github.com/nickshin/CheatSheets/
- https://github.com/github/git-lfs#getting-started
- install your flavor of
git-lfs
- install your flavor of
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
- start tracking lfs files (per project)
cd .../project.git
git lfs track "*.zip"
git add .
git commit -m 'lfs tracking zip files'
- **NOTE**: this should also commit .gitattributes
- push will be done after setting up the server (next)...
- GitLab is pretty nice...
sudo vi /etc/gitlab/gitlab.rb
- to change the URL shown on webpages -- NOTE: MUST USE FQDN !!! postfix need this...
external_url 'http://gitbox.internal:8080'
# e.g. can use alt-port
# !!! keep an eye on `/var/log/gitlab/nginx/current`
# !!! if port already in use -- this will be spammed in logfile
- enable Git LFS -- both are REQUIRED
gitlab_rails['lfs_enabled'] = true
gitlab_rails['lfs_storage_path'] = "/var/opt/gitlab/git-data/lfs-objects"
# -- OR --
gitlab_rails['lfs_storage_path'] = "/mnt/nas/lfs-objects"
- setting up different data storing directory
# NO SYMLNKS
git_data_dir "/mnt/nas/git-data"
- have the changes take effect
sudo gitlab-ctl reconfigure
- BUGFIX: [GitLab Community Edition 8.4.4 9c31cc6]
- if
gitlab_rails['lfs_storage_path']
is undergit_data_dir
- if
sudo chgrp git /var/opt/gitlab/git-data/lfs-objects
- for future reference...
sudo gitlab-ctl stop
# do maintainence here...
sudo gitlab-ctl start
- or "did you turn it off and on again..."
sudo gitlab-ctl restart
- open browser to ( should match
external_url
):http://gitbox.internal
http://gitbox.internal:8080
username: root
password: 5iveL!fe
- as
admin
create a [studio wide group] - as
admin
try creating a project- i.e. project path:
http://gitbox.internal:8080/
-> [studio wide group] ->lfs-test
- i.e. project path:
-
this does work... but mail will get sent to spam folder
- add gitbox.internal to the DNS
- NOTE admin can force confirm user
-
as
normal
make account (you know, for testing) -
as
admin
add all (normal) users to [studio wide group]
ssh-keygen -t rsa -C "[email protected]" -f id_gitlab
cat id_gitlab.pub
# copy output to gitlab account [ profile settings -> ssh keys -> +add ssh key -> key ]
mv id_gitlab* ~/.ssh/.
- if this is not yet set...
git remote add origin [email protected]:studio_wide_group/lfs-test.git
- NOTE: LFS uses http(s) for everything: authentication, obtain the URL of the LFS file, and GET/PUT the LFS file
git config --add lfs.url "http://gitbox.internal/group/project.git/info/lfs"
- credential caching MUST be used (especially when pushing/pulling more than 1 LFS file)
git config --global credential.helper 'cache --timeout=3600'
- finally
git push -u origin master
- http://doc.gitlab.com/ce/workflow/lfs/manage_large_binaries_with_git_lfs.html
- mentions if:
lfs.batch = false
, is in:.../project/.git/config
, to remove it
- mentions if:
git config --unset lfs.batch
- https://gitlab.citius.usc.es/help/workflow/lfs/manage_large_binaries_with_git_lfs.md
- https://github.com/github/git-lfs/blob/master/docs/api/README.md
git clone [email protected]:group/project.git
# this will return error messages...
# but !!! **need to add lfs.url first** !!!
cd project
git config --add lfs.url "http://gitbox.internal/group/project.git/info/lfs"
git checkout -f HEAD
-
it seems that
/var/opt/gitlab/git-data/lfs-objects
will store ALL LFS objects... -
meaning, they are mixed in with all of the projects...
-
need to see if there's an easy way to extract all objects by projects...
-
to redo everything (e.g. testing replication steps):
- WARNING: this will NUKE existing GitLab
sudo gitlab-ctl cleanse
sudo apt-get install --reinstall gitlab-ce
-
open browser to (internal) gitlab page:
http://gitbox.internal
-
make an account for yourself
-
check your email for verification link
-
download windows installer for git and git-lfs
-
right click any folder -> select "Git Bash"
-
make "Git Bash" LFS aware
git lfs install
- jic
git config --global user.name "First Last"
git config --global user.email "[email protected]"
git config --global credential.helper 'cache --timeout=3600'
- !!! MUST DO !!!
git config --global credential.helper wincred
- WARNING: on windows -- ssh key file MUST be id_rsa & id_rsa.pub
ssh-keygen -t rsa -C "[email protected]"
cat id_rsa.pub
# copy output to gitlab webpage [ profile settings -> ssh keys -> +add ssh key -> key ]
mv id_rsa* ~/.ssh/.
-
MUST clone via GIT BASH (but can use any git GUI client after these steps)
-
fire up the ssh private/public key handler -- called the "agent"
eval "$(ssh-agent -s)"
- then follow [CLONING](#CLONING) steps
- if errors here, might need to add hostname to
c:\windows\system32\drivers\etc\hosts
- fire up your favorite git client and add this project
- github's desktop client looks pretty easy/simple
- atlassian's sourcetree also looks good