Skip to content

Commit c1cc288

Browse files
committed
Expand README
1 parent 3a0f1df commit c1cc288

File tree

1 file changed

+52
-6
lines changed

1 file changed

+52
-6
lines changed

README.markdown

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,49 @@
1-
git-uncommit: uncommit and recommit commands for Git, save your commits to patch files
1+
git-uncommit: uncommit and recommit commands for Git, undo commit to patch file
22

33
Git uncommit does exactly what it says: it uncommits the last Git commit, saving the patch.
44

55
Git recommit applies back the last uncommitted patch; after the patch is applied, the patch file is deleted.
66

7-
Usage:
7+
## Usage:
88

99
Let's suppose after much work you have just committed experimental changes to your branch.
1010

11-
````shell
11+
````sh
1212
$ git-commit -m "Experimental changes"
1313
````
1414

1515
You are unsatisfied with the result, but do not want to discard the work, so you run ```git-uncommit```
1616

1717

18-
````shell
18+
````sh
1919
$ git-uncommit
2020
Uncommit: 2edf199-experimental-changes.patch
2121
````
22-
The patch created by ```git-uncommit``` using ```git format-patch``` and is saved to a file: 2edf199-experimental-changes.patch
2322

24-
Comparison with related git commands:
23+
This undoes your experimental commit and creates ```2edf199-experimental-changes.patch```.
24+
25+
You can undo in this way any number of commits; ```git-recommit``` can be used to apply the patches
26+
27+
To apply the last uncommitted patch:
28+
29+
30+
````sh
31+
$ git-recommit
32+
````
33+
34+
To run ```git-recommit``` with any saved patch file to reapply it in the order you want:
35+
36+
````sh
37+
$ git-recommit <patch-file>.patch
38+
````
39+
40+
## Patches
41+
42+
Patches can be readily edited, shared with others and applied in a new order.
43+
44+
Patches are created using ```git format-patch```
45+
46+
## Comparison with related git commands:
2547

2648
```git stash``` can sometimes be used for similar purposes as ```git-uncommit```, the differences are:
2749
* git stash operates on changes to the work tree or index, not already committed changes
@@ -32,3 +54,27 @@ Comparison with related git commands:
3254
```stg``` or ```STGit```: a tool that can also be used to reorder or edit commits, the main differences are:
3355
* ```STGit``` has a much more complex set of command
3456
* it does not save patch files automatically
57+
58+
## Installation
59+
60+
```git-uncommit``` and ```git-recommit``` are stand-alone shell scripts, simply requiring Git to be installed.
61+
62+
In a Unix or Linux system, you can quickly install ```git-recommit``` and ```git-uncommit``` by copying the files to /usr/local/bin.
63+
64+
## Author and licensing terms
65+
66+
````
67+
Copyright (c) 2012, 2013 Michele Bini <michele.bini@gmail.com>
68+
69+
This program is free software: you can redistribute it and/or modify
70+
it under the terms of the version 3 of the GNU General Public License
71+
as published by the Free Software Foundation.
72+
73+
This program is distributed in the hope that it will be useful, but
74+
WITHOUT ANY WARRANTY; without even the implied warranty of
75+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
76+
General Public License for more details.
77+
78+
You should have received a copy of the GNU General Public License
79+
along with this program. If not, see <http://www.gnu.org/licenses/>.
80+
````

0 commit comments

Comments
 (0)