diff --git a/Commands.md b/Commands.md index 0955783..4377530 100644 --- a/Commands.md +++ b/Commands.md @@ -4,6 +4,7 @@ - [`git authors`](#git-authors) - [`git changelog`](#git-changelog) - [`git clear`](#git-clear) + - [`git clear-soft`](#git-clear-soft) - [`git commits-since`](#git-commits-since) - [`git contrib`](#git-contrib) - [`git count`](#git-count) @@ -956,7 +957,11 @@ README.md ## git clear -Does a hard reset and deletes all untracked files from the working directory +Does a hard reset and deletes all untracked files from the working directory, including those in .gitignore. + +## git clear-soft + +Does a soft reset and deletes all untracked files from the working directory, excluding those in .gitignore. ## git merge-repo diff --git a/bin/git-clear b/bin/git-clear index 6d2d5e6..f08b75d 100755 --- a/bin/git-clear +++ b/bin/git-clear @@ -1,6 +1,6 @@ #!/usr/bin/env bash -echo "Sure? - This command may delete files that cannot be recovered. [Y/n]" +echo "Sure? - This command may delete files that cannot be recovered, including those in .gitignore [Y/n]" read ans if [ "$ans" != "n" ] then git clean -d -f -x && git reset --hard diff --git a/bin/git-clear-soft b/bin/git-clear-soft new file mode 100755 index 0000000..003416a --- /dev/null +++ b/bin/git-clear-soft @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +echo "Sure? - This command may delete files that cannot be recovered. Files and directories in .gitignore will be preserved [Y/n]" +read ans +if [ "$ans" != "n" ] + then git clean -d -f && git reset --hard +fi diff --git a/man/git-clear-soft.1 b/man/git-clear-soft.1 new file mode 100644 index 0000000..46b2682 --- /dev/null +++ b/man/git-clear-soft.1 @@ -0,0 +1,35 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "GIT\-CLEAR\-SOFT" "1" "May 2016" "" "" +. +.SH "NAME" +\fBgit\-clear\-soft\fR \- Soft clean up of a repository +. +.SH "SYNOPSIS" +\fBgit\-clear\-soft\fR +. +.SH "DESCRIPTION" +Clears the repository to a state that it looks as if it was freshly cloned with the current HEAD, however, preserving all changes that are located in files and directories listed in \.gitignore\. It is a git\-reset \-\-hard together with deletion of all untracked files that reside inside the working directory, excluding those in \.gitignore\. +. +.SH "EXAMPLES" +Clears the repo\. +. +.IP "" 4 +. +.nf + +$ git clear\-soft +. +.fi +. +.IP "" 0 +. +.SH "AUTHOR" +Modified version of script written by Daniel \'grindhold\' Brendle <\fIgrindhold@gmx\.net\fR> by Matiss Treinis <\fImrtreinis@gmail\.com\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-clear-soft.html b/man/git-clear-soft.html new file mode 100644 index 0000000..f4c3380 --- /dev/null +++ b/man/git-clear-soft.html @@ -0,0 +1,114 @@ + + + + + + git-clear-soft(1) - Soft clean up of a repository + + + + +
+ + + +
    +
  1. git-clear-soft(1)
  2. +
  3. +
  4. git-clear-soft(1)
  5. +
+ +

NAME

+

+ git-clear-soft - Soft clean up of a repository +

+ +

SYNOPSIS

+ +

git-clear-soft

+ +

DESCRIPTION

+ +

Clears the repository to a state that it looks as if it was freshly cloned + with the current HEAD, however, preserving all changes that are located in files and directories listed in .gitignore. It is a git-reset --hard together with + deletion of all untracked files that reside inside the working directory, excluding those in .gitignore.

+ +

EXAMPLES

+ +

Clears the repo.

+ +
$ git clear-soft
+
+ +

AUTHOR

+ +

Modified version of script written by Daniel 'grindhold' Brendle <grindhold@gmx.net> by Matiss Treinis <mrtreinis@gmail.com>

+ +

REPORTING BUGS

+ +

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

+ +

SEE ALSO

+ +

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

+ + +
    +
  1. +
  2. May 2016
  3. +
  4. git-clear-soft(1)
  5. +
+ +
+ + diff --git a/man/git-clear-soft.md b/man/git-clear-soft.md new file mode 100644 index 0000000..b653736 --- /dev/null +++ b/man/git-clear-soft.md @@ -0,0 +1,30 @@ +git-clear-soft(1) -- Soft clean up of a repository +================================================ + +## SYNOPSIS + +`git-clear-soft` + +## DESCRIPTION + + Clears the repository to a state that it looks as if it was freshly cloned + with the current HEAD, however, preserving all changes that are located in files and directories listed in .gitignore. It is a git-reset --hard together with + deletion of all untracked files that reside inside the working directory, excluding those in .gitignore. + +## EXAMPLES + + Clears the repo. + + $ git clear-soft + +## AUTHOR + +Modified version of script written by Daniel 'grindhold' Brendle <> by Matiss Treinis <> + +## REPORTING BUGS + +<> + +## SEE ALSO + +<> diff --git a/man/git-clear.1 b/man/git-clear.1 index 15a5bb1..fede733 100644 --- a/man/git-clear.1 +++ b/man/git-clear.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-CLEAR" "1" "December 2015" "" "" +.TH "GIT\-CLEAR" "1" "May 2016" "" "" . .SH "NAME" \fBgit\-clear\fR \- Rigorously clean up a repository @@ -10,7 +10,7 @@ \fBgit\-clear\fR . .SH "DESCRIPTION" -Clears the repository to a state that it looks as if it was freshly cloned with the current HEAD\. Basically it is a git\-reset \-\-hard together with deletion of all untracked files that reside inside the working directory\. +Clears the repository to a state that it looks as if it was freshly cloned with the current HEAD\. Basically it is a git\-reset \-\-hard together with deletion of all untracked files that reside inside the working directory, including those in \.gitignore\. . .SH "EXAMPLES" Clears the repo\. diff --git a/man/git-clear.html b/man/git-clear.html index 4002b54..ec57152 100644 --- a/man/git-clear.html +++ b/man/git-clear.html @@ -81,7 +81,7 @@

Clears the repository to a state that it looks as if it was freshly cloned with the current HEAD. Basically it is a git-reset --hard together with - deletion of all untracked files that reside inside the working directory.

+ deletion of all untracked files that reside inside the working directory, including those in .gitignore.

EXAMPLES

@@ -92,7 +92,7 @@

AUTHOR

-

Written by Daniel 'grindhold' Brendle <grindhold@gmx.net>

+

Written by Daniel 'grindhold' Brendle <grindhold@gmx.net>

REPORTING BUGS

@@ -105,7 +105,7 @@
  1. -
  2. December 2015
  3. +
  4. May 2016
  5. git-clear(1)
diff --git a/man/git-clear.md b/man/git-clear.md index 8c34062..0239ddd 100644 --- a/man/git-clear.md +++ b/man/git-clear.md @@ -9,7 +9,7 @@ git-clear(1) -- Rigorously clean up a repository Clears the repository to a state that it looks as if it was freshly cloned with the current HEAD. Basically it is a git-reset --hard together with - deletion of all untracked files that reside inside the working directory. + deletion of all untracked files that reside inside the working directory, including those in .gitignore. ## EXAMPLES