diff --git a/Readme.md b/Readme.md index a1cf012ba..fd4b6a976 100644 --- a/Readme.md +++ b/Readme.md @@ -66,6 +66,8 @@ $ brew install git-extras - `git local-commits` - `git archive-file` - `git missing` + - `git lock` + - `git unlock` ## git-extras @@ -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` diff --git a/bin/git-lock b/bin/git-lock new file mode 100755 index 000000000..9b7bbd4a0 --- /dev/null +++ b/bin/git-lock @@ -0,0 +1,5 @@ +#!/bin/sh + +filename=$1 +test -z $filename && echo "filename required." 1>&2 && exit 1 +git update-index --skip-worktree $filename diff --git a/bin/git-unlock b/bin/git-unlock new file mode 100644 index 000000000..42c02dfbf --- /dev/null +++ b/bin/git-unlock @@ -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 diff --git a/man/git-lock.1 b/man/git-lock.1 new file mode 100644 index 000000000..9f98f609e --- /dev/null +++ b/man/git-lock.1 @@ -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 +. +.SH "DESCRIPTION" +Lock local files from version control\. +. +.SH "OPTIONS" + +. +.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> diff --git a/man/git-lock.html b/man/git-lock.html new file mode 100644 index 000000000..753bb82c0 --- /dev/null +++ b/man/git-lock.html @@ -0,0 +1,117 @@ + + + + + + git-lock(1) - Lock a file excluded from version control + + + + +
+ + + +
    +
  1. git-lock(1)
  2. +
  3. +
  4. git-lock(1)
  5. +
+ +

NAME

+

+ git-lock - Lock a file excluded from version control +

+ +

SYNOPSIS

+ +

git-lock <filename>

+ +

DESCRIPTION

+ +

Lock local files from version control.

+ +

OPTIONS

+ +

<filename>

+ +

The name of the filename.

+ +

EXAMPLES

+ +
$ git lock config/database.yml
+
+ +

AUTHOR

+ +

Written by Julio Napuri <julionc@gmail.com>

+ +

REPORTING BUGS

+ +

<https://github.com/visionmedia/git-extras/issues>

+ +

SEE ALSO

+ +

<https://github.com/visionmedia/git-extras>

+ + +
    +
  1. +
  2. December 2013
  3. +
  4. git-lock(1)
  5. +
+ +
+ + diff --git a/man/git-lock.md b/man/git-lock.md new file mode 100644 index 000000000..a208ffb6f --- /dev/null +++ b/man/git-lock.md @@ -0,0 +1,32 @@ +git-lock(1) -- Lock a file excluded from version control +======================================================== + +## SYNOPSIS + +`git-lock` <filename> + +## DESCRIPTION + + Lock local files from version control. + +## OPTIONS + + <filename> + + The name of the filename. + +## EXAMPLES + + $ git lock config/database.yml + +## AUTHOR + +Written by Julio Napuri <> + +## REPORTING BUGS + +<> + +## SEE ALSO + +<> diff --git a/man/git-unlock.1 b/man/git-unlock.1 new file mode 100644 index 000000000..037778c5f --- /dev/null +++ b/man/git-unlock.1 @@ -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 +. +.SH "DESCRIPTION" +Unlock local files from version control\. +. +.SH "OPTIONS" + +. +.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> diff --git a/man/git-unlock.html b/man/git-unlock.html new file mode 100644 index 000000000..4c0c3d553 --- /dev/null +++ b/man/git-unlock.html @@ -0,0 +1,117 @@ + + + + + + git-unlock(1) - Unlock a file excluded from version control + + + + +
+ + + +
    +
  1. git-unlock(1)
  2. +
  3. +
  4. git-unlock(1)
  5. +
+ +

NAME

+

+ git-unlock - Unlock a file excluded from version control +

+ +

SYNOPSIS

+ +

git-lock <filename>

+ +

DESCRIPTION

+ +

Unlock local files from version control.

+ +

OPTIONS

+ +

<filename>

+ +

The name of the filename.

+ +

EXAMPLES

+ +
$ git unlock config/database.yml
+
+ +

AUTHOR

+ +

Written by Julio Napuri <julionc@gmail.com>

+ +

REPORTING BUGS

+ +

<https://github.com/visionmedia/git-extras/issues>

+ +

SEE ALSO

+ +

<https://github.com/visionmedia/git-extras>

+ + +
    +
  1. +
  2. December 2013
  3. +
  4. git-unlock(1)
  5. +
+ +
+ + diff --git a/man/git-unlock.md b/man/git-unlock.md new file mode 100644 index 000000000..be53f6c63 --- /dev/null +++ b/man/git-unlock.md @@ -0,0 +1,32 @@ +git-unlock(1) -- Unlock a file excluded from version control +============================================================ + +## SYNOPSIS + +`git-lock` <filename> + +## DESCRIPTION + + Unlock local files from version control. + +## OPTIONS + + <filename> + + The name of the filename. + +## EXAMPLES + + $ git unlock config/database.yml + +## AUTHOR + +Written by Julio Napuri <> + +## REPORTING BUGS + +<> + +## SEE ALSO + +<>