HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

git lock — Lock a file in a Git repository from being modified by a commit. Part of `git-extras`. See also: `gi

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandgit lockfromclifilerepositorygitlock

Problem

How to use the git lock command: Lock a file in a Git repository from being modified by a commit. Part of git-extras. See also: git-unlock. More information: <https://github.com/tj/git-extras/blob/main/Commands.md#git-lock>.

Solution

git lock — Lock a file in a Git repository from being modified by a commit. Part of git-extras. See also: git-unlock. More information: <https://github.com/tj/git-extras/blob/main/Commands.md#git-lock>.

Disable the ability to commit changes of a local file:
git lock {{path/to/file}}

Code Snippets

Disable the ability to commit changes of a local file

git lock {{path/to/file}}

Context

tldr-pages: common/git lock

Revisions (0)

No revisions yet.