Skip to content

Commit 0bd08f7

Browse files
author
Rafal Chmiel
committed
Merge pull request tiimgreen#65 from cgcgbcbc/fix-up-and-autosquash
git fixup and autosquash
2 parents bd492eb + 75f179d commit 0bd08f7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c
5555
- [Styled Git Log](#styled-git-log)
5656
- [Git Query](#git-query)
5757
- [Merged Branches](#merged-branches)
58+
- [Fixup and Autosquash](#fixup-and-autosquash)
5859
- [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories)
5960
- [Git Configurations](#git-configurations)
6061
- [Aliases](#aliases)
@@ -722,6 +723,15 @@ Will give you a list of branches that have not been merged into your current bra
722723

723724
[*Read more about the Git `branch` command.*](http://git-scm.com/docs/git-branch)
724725

726+
### Fixup and Autosquash
727+
If there is something wrong with a previous commit (can be one or more from HEAD), for example `abcde`, run the following command after you've amended the problem:
728+
```bash
729+
$ git commit --fixup=abcde
730+
$ git rebase abcde^ --autosquash -i
731+
```
732+
[*Read more about the Git `commit` command.*](http://git-scm.com/docs/git-commit)
733+
[*Read more about the Git `rebase` command.*](http://git-scm.com/docs/git-rebase)
734+
725735
### Web Server for Browsing Local Repositories
726736
Use the Git `instaweb` command to instantly browse your working repository in `gitweb`. This command is a simple script to set up `gitweb` and a web server for browsing the local repository.
727737

0 commit comments

Comments
 (0)