Skip to content

Commit 3a0f1df

Browse files
committed
Add a README
1 parent b0f82f3 commit 3a0f1df

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.markdown

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
git-uncommit: uncommit and recommit commands for Git, save your commits to patch files
2+
3+
Git uncommit does exactly what it says: it uncommits the last Git commit, saving the patch.
4+
5+
Git recommit applies back the last uncommitted patch; after the patch is applied, the patch file is deleted.
6+
7+
Usage:
8+
9+
Let's suppose after much work you have just committed experimental changes to your branch.
10+
11+
````shell
12+
$ git-commit -m "Experimental changes"
13+
````
14+
15+
You are unsatisfied with the result, but do not want to discard the work, so you run ```git-uncommit```
16+
17+
18+
````shell
19+
$ git-uncommit
20+
Uncommit: 2edf199-experimental-changes.patch
21+
````
22+
The patch created by ```git-uncommit``` using ```git format-patch``` and is saved to a file: 2edf199-experimental-changes.patch
23+
24+
Comparison with related git commands:
25+
26+
```git stash``` can sometimes be used for similar purposes as ```git-uncommit```, the differences are:
27+
* git stash operates on changes to the work tree or index, not already committed changes
28+
* git stash does not create a patch file, but saves the changes in the git archive
29+
30+
```git reset HEAD^``` can also be used to revert the last commit, however the changes are not saved to a patch file, they are either discarded or left in the index or work tree, depending on the options you give to '''git reset'''
31+
32+
```stg``` or ```STGit```: a tool that can also be used to reorder or edit commits, the main differences are:
33+
* ```STGit``` has a much more complex set of command
34+
* it does not save patch files automatically

0 commit comments

Comments
 (0)