Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1eeacb0c
Commit
1eeacb0c
authored
Jan 26, 2018
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update LFS docs with File Locking section
parent
1719b1b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
doc/workflow/lfs/manage_large_binaries_with_git_lfs.md
doc/workflow/lfs/manage_large_binaries_with_git_lfs.md
+65
-0
No files found.
doc/workflow/lfs/manage_large_binaries_with_git_lfs.md
View file @
1eeacb0c
...
...
@@ -83,6 +83,71 @@ that are on the remote repository, eg. from branch `master`:
git lfs fetch master
```
## File Locking
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
git lfs track
"*.png"
--lockable
```
After executing the above command a file named
`.gitattributes`
will be
created or updated with the following content:
```
bash
*
.png
filter
=
lfs
diff
=
lfs
merge
=
lfs
-text
lockable
```
You can also register a file type as lockable without using LFS, in
order to do that you can edit the
`.gitattributes`
file manually:
```
bash
*
.pdf lockable
```
After a file type has been registered as lockable, Git LFS will make
them readonly on the file system automatically. This means you will
need to lock the file before editing it.
### Managing Locked Files
Once you're ready to edit your file you need to lock it first:
```
bash
git lfs lock images/banner.png
Locked images/banner.png
```
This will register the file as locked in your name on the server:
```
bash
git lfs locks
images/banner.png joe ID:123
```
Once you have pushed your changes, you can unlock the file so others can
also edit it:
```
bash
git lfs unlock images/banner.png
```
You can also unlock by id:
```
bash
git lfs unlock
--id
=
123
```
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
`master`
access on
the project:
```
bash
git lfs unlock
--id
=
123
--force
```
## Troubleshooting
### error: Repository or object not found
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment