From 61fee79cc710ac843d2bdfb43a65c181608aee7b Mon Sep 17 00:00:00 2001
From: Matiss
Date: Sun, 1 May 2016 19:05:21 +0200
Subject: [PATCH 1/2] Add git-clear-soft command Modify git-clear to
indicate default behavior of removing git ignored files
---
Commands.md | 7 ++-
bin/git-clear | 2 +-
bin/git-clear-soft | 7 +++
man/git-clear-soft.1 | 35 ++++++++++++
man/git-clear-soft.html | 114 ++++++++++++++++++++++++++++++++++++++++
man/git-clear-soft.md | 30 +++++++++++
man/git-clear.1 | 4 +-
man/git-clear.html | 6 +--
man/git-clear.md | 2 +-
9 files changed, 199 insertions(+), 8 deletions(-)
create mode 100755 bin/git-clear-soft
create mode 100644 man/git-clear-soft.1
create mode 100644 man/git-clear-soft.html
create mode 100644 man/git-clear-soft.md
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
+
+
+
+
+
+
+
+
+
+ - git-clear-soft(1)
+
+ - git-clear-soft(1)
+
+
+
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>
+
+
+
+
+
+
+
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 @@
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
From 3783a27a39e1e62c083a5bff03548f77eb717391 Mon Sep 17 00:00:00 2001
From: Matiss
Date: Sun, 1 May 2016 19:10:54 +0200
Subject: [PATCH 2/2] Edit description of git clear-soft to indicate hard reset
---
Commands.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Commands.md b/Commands.md
index 4377530..19be3f8 100644
--- a/Commands.md
+++ b/Commands.md
@@ -961,7 +961,7 @@ Does a hard reset and deletes all untracked files from the working directory, in
## git clear-soft
-Does a soft reset and deletes all untracked files from the working directory, excluding those in .gitignore.
+Does a hard reset and deletes all untracked files from the working directory, excluding those in .gitignore.
## git merge-repo