diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-30 15:09:15 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-30 15:09:15 +0000 |
commit | 536aa3a1f4b96abc4ca34489bf2cbe503afcded7 (patch) | |
tree | 88d08f7dfa29a32d6526773c4fe0fefd9f2bc7d1 /doc/administration/lfs | |
parent | 50ae4065530c4eafbeb7c5ff2c462c48c02947ca (diff) | |
download | gitlab-ce-536aa3a1f4b96abc4ca34489bf2cbe503afcded7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/administration/lfs')
3 files changed, 34 insertions, 34 deletions
diff --git a/doc/administration/lfs/lfs_administration.md b/doc/administration/lfs/lfs_administration.md index fbf48619854..68a5939dcd1 100644 --- a/doc/administration/lfs/lfs_administration.md +++ b/doc/administration/lfs/lfs_administration.md @@ -138,13 +138,13 @@ There are two ways to manually do the same thing as automatic uploading (describ **Option 1: rake task** -```sh +```shell rake gitlab:lfs:migrate ``` **Option 2: rails console** -```sh +```shell $ sudo gitlab-rails console # Login to rails console > # Upload LFS files manually @@ -178,7 +178,7 @@ On Omnibus installations, the settings are prefixed by `lfs_object_store_`: 1. Save the file and [reconfigure GitLab]s for the changes to take effect. 1. Migrate any existing local LFS objects to the object storage: - ```bash + ```shell gitlab-rake gitlab:lfs:migrate ``` @@ -214,7 +214,7 @@ For source installations the settings are nested under `lfs:` and then 1. Save the file and [restart GitLab][] for the changes to take effect. 1. Migrate any existing local LFS objects to the object storage: - ```bash + ```shell sudo -u git -H bundle exec rake gitlab:lfs:migrate RAILS_ENV=production ``` diff --git a/doc/administration/lfs/manage_large_binaries_with_git_lfs.md b/doc/administration/lfs/manage_large_binaries_with_git_lfs.md index 1fd3077ecb9..025b547c37e 100644 --- a/doc/administration/lfs/manage_large_binaries_with_git_lfs.md +++ b/doc/administration/lfs/manage_large_binaries_with_git_lfs.md @@ -50,7 +50,7 @@ Lets take a look at the workflow when you need to check large files into your Gi repository with Git LFS. For example, if you want to upload a very large file and check it into your Git repository: -```bash +```shell git clone git@gitlab.example.com:group/project.git git lfs install # initialize the Git LFS project git lfs track "*.iso" # select the file extensions that you want to treat as large files @@ -59,7 +59,7 @@ git lfs track "*.iso" # select the file extensions that you want Once a certain file extension is marked for tracking as a LFS object you can use Git as usual without having to redo the command to track a file with the same extension: -```bash +```shell cp ~/tmp/debian.iso ./ # copy a large file into the current directory git add . # add the large file to the project git commit -am "Added Debian iso" # commit the file meta data @@ -69,7 +69,7 @@ git push origin master # sync the git repo and large file to the **Make sure** that `.gitattributes` is tracked by Git. Otherwise Git LFS will not be working properly for people cloning the project: -```bash +```shell git add .gitattributes ``` @@ -78,14 +78,14 @@ LFS-tracked files and clones them via HTTP. If you performed the `git clone` command with a SSH URL, you have to enter your GitLab credentials for HTTP authentication. -```bash +```shell git clone git@gitlab.example.com:group/project.git ``` If you already cloned the repository and you want to get the latest LFS object that are on the remote repository, eg. for a branch from origin: -```bash +```shell git lfs fetch origin master ``` @@ -101,14 +101,14 @@ The first thing to do before using File Locking is to tell Git LFS which kind of files are lockable. The following command will store PNG files in LFS and flag them as lockable: -```bash +```shell git lfs track "*.png" --lockable ``` After executing the above command a file named `.gitattributes` will be created or updated with the following content: -```bash +```shell *.png filter=lfs diff=lfs merge=lfs -text lockable ``` @@ -116,7 +116,7 @@ You can also register a file type as lockable without using LFS (In order to be able to lock/unlock a file you need a remote server that implements the LFS File Locking API), in order to do that you can edit the `.gitattributes` file manually: -```bash +```shell *.pdf lockable ``` @@ -128,14 +128,14 @@ need to lock the file before editing it. Once you're ready to edit your file you need to lock it first: -```bash +```shell git lfs lock images/banner.png Locked images/banner.png ``` This will register the file as locked in your name on the server: -```bash +```shell git lfs locks images/banner.png joe ID:123 ``` @@ -143,13 +143,13 @@ images/banner.png joe ID:123 Once you have pushed your changes, you can unlock the file so others can also edit it: -```bash +```shell git lfs unlock images/banner.png ``` You can also unlock by id: -```bash +```shell git lfs unlock --id=123 ``` @@ -157,7 +157,7 @@ If for some reason you need to unlock a file that was not locked by you, you can use the `--force` flag as long as you have a `maintainer` access on the project: -```bash +```shell git lfs unlock --id=123 --force ``` @@ -183,7 +183,7 @@ available to the project anymore. Probably the object was removed from the serve Git LFS will log the failures into a log file. To view this log file, while in project directory: -```bash +```shell git lfs logs last ``` @@ -215,7 +215,7 @@ This behaviour is caused by Git LFS using HTTPS connections by default when a To prevent this from happening, set the lfs url in project Git config: -```bash +```shell git config --add lfs.url "http://gitlab.example.com/group/project.git/info/lfs" ``` @@ -235,7 +235,7 @@ you use. This is described in [Git credentials man pages](https://git-scm.com/do For example, you can tell Git to remember the password for a period of time in which you expect to push the objects: -```bash +```shell git config --global credential.helper 'cache --timeout=3600' ``` diff --git a/doc/administration/lfs/migrate_from_git_annex_to_git_lfs.md b/doc/administration/lfs/migrate_from_git_annex_to_git_lfs.md index cf798472d62..3f983bebf27 100644 --- a/doc/administration/lfs/migrate_from_git_annex_to_git_lfs.md +++ b/doc/administration/lfs/migrate_from_git_annex_to_git_lfs.md @@ -48,7 +48,7 @@ Fire up a terminal, navigate to your Git repository and: 1. Disable `git-annex`: - ```bash + ```shell git annex sync --content git annex direct git annex uninit @@ -85,7 +85,7 @@ if the server also has Git Annex 6 installed. Read more in the 1. Backup your repository - ```bash + ```shell cd repository git annex sync --content cd .. @@ -97,14 +97,14 @@ if the server also has Git Annex 6 installed. Read more in the 1. Use `annex direct`: - ```bash + ```shell cd repository git annex direct ``` The output should be similar to this: - ```bash + ```shell commit On branch master Your branch is up-to-date with 'origin/master'. @@ -116,13 +116,13 @@ if the server also has Git Annex 6 installed. Read more in the 1. Disable Git Annex with [`annex uninit`][uninit]: - ```bash + ```shell git annex uninit ``` The output should be similar to this: - ```bash + ```shell unannex debian.iso ok Deleted branch git-annex (was 2534d2c). ``` @@ -131,13 +131,13 @@ if the server also has Git Annex 6 installed. Read more in the 1. Switch back to `indirect` mode: - ```bash + ```shell git annex indirect ``` The output should be similar to this: - ```bash + ```shell (merging origin/git-annex into git-annex...) (recording state in git...) commit (recording state in git...) @@ -165,7 +165,7 @@ GitLab.com), therefore, you don't need to do anything server-side. 1. First, make sure you have `git-lfs` installed locally: - ```bash + ```shell git lfs help ``` @@ -174,7 +174,7 @@ GitLab.com), therefore, you don't need to do anything server-side. 1. Inside the repo, run the following command to initiate LFS: - ```bash + ```shell git lfs install ``` @@ -182,7 +182,7 @@ GitLab.com), therefore, you don't need to do anything server-side. can track specific files, all files containing the same extension, or an entire directory: - ```bash + ```shell git lfs track images/01.png # per file git lfs track **/*.png # per extension git lfs track images/ # per directory @@ -194,7 +194,7 @@ GitLab.com), therefore, you don't need to do anything server-side. 1. Add the files, commit and push them to GitLab: - ```bash + ```shell git add . git commit -m "commit message" git push @@ -217,7 +217,7 @@ branches created by Git Annex: `git-annex`, and all under `synced/`. You can also do this on the command line with: -```bash +```shell git branch -d synced/master git branch -d synced/git-annex git push origin :synced/master @@ -229,7 +229,7 @@ git remote prune origin If there are still some Annex objects inside your repository (`.git/annex/`) or references inside `.git/config`, run `annex uninit` again: -```bash +```shell git annex uninit ``` |