Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added git-undo for removing recent commits.

  • Loading branch information...
commit 22ac3672848b522ad3b40894e1725b161870401f 1 parent 27e0d0e
Kenneth Reitz kennethreitz authored visionmedia committed

Showing 3 changed files with 24 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  Makefile
  2. +11 0 Readme.md
  3. +11 0 bin/git-undo
3  Makefile
@@ -14,7 +14,8 @@ BINS = \
14 14 git-contrib \
15 15 git-update-extras \
16 16 git-extras-version \
17   - git-release
  17 + git-release \
  18 + git-undo
18 19
19 20 install:
20 21 @echo "... installing to $(PREFIX)/bin"
11 Readme.md
Source Rendered
@@ -207,6 +207,17 @@ Listing commits:
207 207 * Added --all support to git-count
208 208 * Initial commit
209 209
  210 +## git-undo
  211 +
  212 +Removes the latest commit
  213 +
  214 + git undo
  215 +
  216 +Remove the latest 3 commits:
  217 +
  218 + git undo 3
  219 +
  220 +
210 221 ## git-update-extras
211 222
212 223 Updates git extras. clones the repo to _/tmp/git-extras_, make installs, then cds back to the origin directory.
11 bin/git-undo
... ... @@ -0,0 +1,11 @@
  1 +#!/bin/sh
  2 +
  3 +if test $# -eq 0; then
  4 + git reset --hard HEAD~1
  5 +else
  6 + if `echo $1 | grep -q [^[:digit:]]`; then
  7 + echo $1 is not a number
  8 + else
  9 + git reset --hard HEAD~$1
  10 + fi
  11 +fi

0 comments on commit 22ac367

Please sign in to comment.
Something went wrong with that request. Please try again.