Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locking files in git repository #202

Merged
merged 3 commits into from
Jul 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ $ brew install git-extras
- `git local-commits`
- `git archive-file`
- `git missing`
- `git lock`
- `git unlock`

## git-extras

Expand Down Expand Up @@ -549,3 +551,15 @@ Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging README.txt
```

## git-lock [filename]

Lock a local file `filename`:

```bash
$ git lock config/database.yml
```

## git-unlock [filename]

Unlock a local file `filename`
5 changes: 5 additions & 0 deletions bin/git-lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

filename=$1
test -z $filename && echo "filename required." 1>&2 && exit 1
git update-index --skip-worktree $filename
5 changes: 5 additions & 0 deletions bin/git-unlock
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

filename=$1
test -z $filename && echo "filename required." 1>&2 && exit 1
git update-index --no-skip-worktree $filename
36 changes: 36 additions & 0 deletions man/git-lock.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-LOCK" "1" "December 2013" "" ""
.
.SH "NAME"
\fBgit\-lock\fR \- Lock a file excluded from version control
.
.SH "SYNOPSIS"
\fBgit\-lock\fR <filename>
.
.SH "DESCRIPTION"
Lock local files from version control\.
.
.SH "OPTIONS"
<filename>
.
.P
The name of the filename\.
.
.SH "EXAMPLES"
.
.nf

$ git lock config/database\.yml
.
.fi
.
.SH "AUTHOR"
Written by Julio Napuri <\fIjulionc@gmail\.com\fR>
.
.SH "REPORTING BUGS"
<\fIhttps://github\.com/visionmedia/git\-extras/issues\fR>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/visionmedia/git\-extras\fR>
117 changes: 117 additions & 0 deletions man/git-lock.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions man/git-lock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
git-lock(1) -- Lock a file excluded from version control
========================================================

## SYNOPSIS

`git-lock` &lt;filename&gt;

## DESCRIPTION

Lock local files from version control.

## OPTIONS

&lt;filename&gt;

The name of the filename.

## EXAMPLES

$ git lock config/database.yml

## AUTHOR

Written by Julio Napuri &lt;<[email protected]>&gt;

## REPORTING BUGS

&lt;<https://github.com/visionmedia/git-extras/issues>&gt;

## SEE ALSO

&lt;<https://github.com/visionmedia/git-extras>&gt;
36 changes: 36 additions & 0 deletions man/git-unlock.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-UNLOCK" "1" "December 2013" "" ""
.
.SH "NAME"
\fBgit\-unlock\fR \- Unlock a file excluded from version control
.
.SH "SYNOPSIS"
\fBgit\-lock\fR <filename>
.
.SH "DESCRIPTION"
Unlock local files from version control\.
.
.SH "OPTIONS"
<filename>
.
.P
The name of the filename\.
.
.SH "EXAMPLES"
.
.nf

$ git unlock config/database\.yml
.
.fi
.
.SH "AUTHOR"
Written by Julio Napuri <\fIjulionc@gmail\.com\fR>
.
.SH "REPORTING BUGS"
<\fIhttps://github\.com/visionmedia/git\-extras/issues\fR>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/visionmedia/git\-extras\fR>
117 changes: 117 additions & 0 deletions man/git-unlock.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading