mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
Merge pull request #43 from kennethreitz/feature/git-back
Added `git-back` command for soft undos [kennethreitz]
This commit is contained in:
commit
0ce6d057ba
11
bin/git-back
Executable file
11
bin/git-back
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
if test $# -eq 0; then
|
||||
git reset --soft HEAD~1
|
||||
else
|
||||
if `echo $1 | grep -q [^[:digit:]]`; then
|
||||
echo $1 is not a number
|
||||
else
|
||||
git reset --soft HEAD~$1
|
||||
fi
|
||||
fi
|
||||
38
man/git-back.md
Normal file
38
man/git-back.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
git-back(1) -- Undo and Stage latest commits
|
||||
============================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
`git-back` [<commitcount>]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Removes the latest commits, and add their changes to your staging area.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
<commitcount>
|
||||
|
||||
Number of commits to remove. Defaults to *1*, thus remove the latest commit.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
Removes the latest commit.
|
||||
|
||||
$ git back
|
||||
|
||||
Remove the latest 3 commits:
|
||||
|
||||
$ git back 3
|
||||
|
||||
## AUTHOR
|
||||
|
||||
Written by Kenneth Reitz <<me@kennethreitz.com>>
|
||||
|
||||
## REPORTING BUGS
|
||||
|
||||
<<http://github.com/visionmedia/git-extras/issues>>
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
<<http://github.com/visionmedia/git-extras>>
|
||||
Loading…
Reference in a new issue