Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 24 lines (19 sloc) 0.512 kB
c6b23cd @rosslagerwall Initial commit. git-null command is working.
authored
1 #!/bin/sh
2
3 if [ ! -d `pwd`/.git ]; then
4 echo "Not in a git dir!"
809f7ed @rosslagerwall Use exit instead of return when not inside a function.
authored
5 exit 1
c6b23cd @rosslagerwall Initial commit. git-null command is working.
authored
6 fi
7
8 OUTPUT=$(git status -s)
9 if [ -n "$OUTPUT" ]; then
10 echo "Modified files exist in the Git working tree."
809f7ed @rosslagerwall Use exit instead of return when not inside a function.
authored
11 exit 1
c6b23cd @rosslagerwall Initial commit. git-null command is working.
authored
12 fi
13
14 OUTPUT=$(git clean -n -x -d)
15 if [ -n "$OUTPUT" ]; then
16 echo "Git repository not clean."
17 echo "Remove all unversioned files and directories."
809f7ed @rosslagerwall Use exit instead of return when not inside a function.
authored
18 exit 1
c6b23cd @rosslagerwall Initial commit. git-null command is working.
authored
19 fi
20
f2fe464 @rosslagerwall Remove sleep from git-null
authored
21 echo "Updating `pwd` to the *null* revision."
22 find . ! -path './.git*' -delete
c6b23cd @rosslagerwall Initial commit. git-null command is working.
authored
23 echo "To go back to the previous state, run: git reset --hard"
Something went wrong with that request. Please try again.