diff --git a/Commands.md b/Commands.md index 228df36d2..a41ff4a72 100644 --- a/Commands.md +++ b/Commands.md @@ -65,6 +65,8 @@ - [`git touch`](#git-touch) - [`git undo`](#git-undo) - [`git unlock`](#git-unlock) + - [`git unwip`](#git-unwip) + - [`git wip`](#git-wip) ## git extras @@ -1349,3 +1351,21 @@ Sync local branch with origin/master ```bash $ git sync origin master ``` + +## git wip + +Create a Work In Progress(WIP) commit, which will include all changes in the +working directory. (i.e., changes to existing files, new files, removed files) + +```bash +$ git wip +``` + +## git unwip + +Undo A Work In Progress(WIP) commit and put all of those changes back into the +working directory. + +```bash +$ git unwip +``` diff --git a/bin/git-unwip b/bin/git-unwip new file mode 100755 index 000000000..50b85f464 --- /dev/null +++ b/bin/git-unwip @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Based on scripts from git-utils: +# * https://github.com/ddollar/git-utils/blob/master/git-unwip + +# Check if the last commit is a 'WIP' commit +LAST_COMMIT=`git log -1 --pretty=%B | tr --delete '[:space:]'` + +if [ 'WIP' != $LAST_COMMIT ]; then + echo 'Last commit is not a WIP commit, so it will not be unWIP-ed.' + exit +fi + +git undo diff --git a/bin/git-wip b/bin/git-wip new file mode 100755 index 000000000..a25d68fe7 --- /dev/null +++ b/bin/git-wip @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Based on scripts from git-utils: +# * https://github.com/ddollar/git-utils/blob/master/git-wip +# * https://github.com/ddollar/git-utils/blob/master/git-addremove + +git add --all +git commit --all --message="WIP" diff --git a/etc/git-extras-completion.zsh b/etc/git-extras-completion.zsh index 2fc84c8fb..af0e7dec4 100644 --- a/etc/git-extras-completion.zsh +++ b/etc/git-extras-completion.zsh @@ -430,4 +430,6 @@ zstyle ':completion:*:*:git:*' user-commands \ sync:'sync local branch with remote branch' \ touch:'touch and add file to the index' \ undo:'remove latest commits' \ - unlock:'unlock a file excluded from version control' + unlock:'unlock a file excluded from version control' \ + unwip:'undo a WIP commit' \ + wip:'create a WIP commit' diff --git a/man/git-unwip.1 b/man/git-unwip.1 new file mode 100644 index 000000000..b4d094912 --- /dev/null +++ b/man/git-unwip.1 @@ -0,0 +1,51 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "GIT\-UNWIP" "1" "July 2017" "" "" +. +.SH "NAME" +\fBgit\-unwip\fR \- Undo a Work In Progress commit +. +.SH "SYNOPSIS" +\fBgit\-unwip\fR +. +.SH "DESCRIPTION" +Undo a Work In Progress commit\. +. +.SH "OPTIONS" +None +. +.SH "EXAMPLES" +Create a WIP commit which stores all changes in the working directory\. +. +.IP "" 4 +. +.nf + +$ git wip +. +.fi +. +.IP "" 0 +. +.P +Later on, undo the commit and continue making changes\. +. +.IP "" 4 +. +.nf + +$ git unwip +. +.fi +. +.IP "" 0 +. +.SH "AUTHOR" +Written by Andrew Sullivan Cant <\fImail@andrewsullivancant\.ca\fR> +. +.SH "REPORTING BUGS" +<\fIhttps://github\.com/tj/git\-extras/issues\fR> +. +.SH "SEE ALSO" +<\fIhttps://github\.com/tj/git\-extras\fR> diff --git a/man/git-unwip.html b/man/git-unwip.html new file mode 100644 index 000000000..039c70a32 --- /dev/null +++ b/man/git-unwip.html @@ -0,0 +1,122 @@ + + + + + + git-unwip(1) - Undo a Work In Progress commit + + + + +
+ + + +
    +
  1. git-unwip(1)
  2. +
  3. +
  4. git-unwip(1)
  5. +
+ +

NAME

+

+ git-unwip - Undo a Work In Progress commit +

+ +

SYNOPSIS

+ +

git-unwip

+ +

DESCRIPTION

+ +

Undo a Work In Progress commit.

+ +

OPTIONS

+ +

None

+ +

EXAMPLES

+ +

Create a WIP commit which stores all changes in the working directory.

+ +
$ git wip
+
+ +

Later on, undo the commit and continue making changes.

+ +
$ git unwip
+
+ +

AUTHOR

+ +

Written by Andrew Sullivan Cant <mail@andrewsullivancant.ca>

+ +

REPORTING BUGS

+ +

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

+ +

SEE ALSO

+ +

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

+ + +
    +
  1. +
  2. July 2017
  3. +
  4. git-unwip(1)
  5. +
+ +
+ + diff --git a/man/git-unwip.md b/man/git-unwip.md new file mode 100644 index 000000000..6d4d961bb --- /dev/null +++ b/man/git-unwip.md @@ -0,0 +1,36 @@ +git-unwip(1) -- Undo a Work In Progress commit +================================ + +## SYNOPSIS + +`git-unwip` + +## DESCRIPTION + + Undo a Work In Progress commit. + +## OPTIONS + + None + +## EXAMPLES + + Create a WIP commit which stores all changes in the working directory. + + $ git wip + + Later on, undo the commit and continue making changes. + + $ git unwip + +## AUTHOR + +Written by Andrew Sullivan Cant <> + +## REPORTING BUGS + +<> + +## SEE ALSO + +<> diff --git a/man/git-wip.1 b/man/git-wip.1 new file mode 100644 index 000000000..3dec12cfd --- /dev/null +++ b/man/git-wip.1 @@ -0,0 +1,51 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "GIT\-WIP" "1" "July 2017" "" "" +. +.SH "NAME" +\fBgit\-wip\fR \- Create a Work In Progress commit +. +.SH "SYNOPSIS" +\fBgit\-wip\fR +. +.SH "DESCRIPTION" +Create a Work In Progress commit, include all files in the working directory\. +. +.SH "OPTIONS" +None +. +.SH "EXAMPLES" +Create a WIP commit which stores all changes in the working directory\. +. +.IP "" 4 +. +.nf + +$ git wip +. +.fi +. +.IP "" 0 +. +.P +Later on, undo the commit and continue making changes\. +. +.IP "" 4 +. +.nf + +$ git unwip +. +.fi +. +.IP "" 0 +. +.SH "AUTHOR" +Written by \fIAndrew Sullivan Cant\fR \fImail@andrewsullivancant\.ca\fR +. +.SH "REPORTING BUGS" +<\fIhttps://github\.com/tj/git\-extras/issues\fR> +. +.SH "SEE ALSO" +<\fIhttps://github\.com/tj/git\-extras\fR> diff --git a/man/git-wip.html b/man/git-wip.html new file mode 100644 index 000000000..352a64387 --- /dev/null +++ b/man/git-wip.html @@ -0,0 +1,122 @@ + + + + + + git-wip(1) - Create a Work In Progress commit + + + + +
+ + + +
    +
  1. git-wip(1)
  2. +
  3. +
  4. git-wip(1)
  5. +
+ +

NAME

+

+ git-wip - Create a Work In Progress commit +

+ +

SYNOPSIS

+ +

git-wip

+ +

DESCRIPTION

+ +

Create a Work In Progress commit, include all files in the working directory.

+ +

OPTIONS

+ +

None

+ +

EXAMPLES

+ +

Create a WIP commit which stores all changes in the working directory.

+ +
$ git wip
+
+ +

Later on, undo the commit and continue making changes.

+ +
$ git unwip
+
+ +

AUTHOR

+ +

Written by Andrew Sullivan Cant mail@andrewsullivancant.ca

+ +

REPORTING BUGS

+ +

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

+ +

SEE ALSO

+ +

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

+ + +
    +
  1. +
  2. July 2017
  3. +
  4. git-wip(1)
  5. +
+ +
+ + diff --git a/man/git-wip.md b/man/git-wip.md new file mode 100644 index 000000000..de5b433f3 --- /dev/null +++ b/man/git-wip.md @@ -0,0 +1,36 @@ +git-wip(1) -- Create a Work In Progress commit +================================ + +## SYNOPSIS + +`git-wip` + +## DESCRIPTION + + Create a Work In Progress commit, include all files in the working directory. + +## OPTIONS + + None + +## EXAMPLES + + Create a WIP commit which stores all changes in the working directory. + + $ git wip + + Later on, undo the commit and continue making changes. + + $ git unwip + +## AUTHOR + +Written by + +## REPORTING BUGS + +<> + +## SEE ALSO + +<>