8000 git fixup and autosquash · johnzgit/github-cheat-sheet@75f179d · GitHub
[go: up one dir, main page]

Skip to content

Commit 75f179d

Browse files
committed
git fixup and autosquash
1 parent fd092f3 commit 75f179d

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
@@ -48,6 +48,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c
4848
- [Styled Git Log](#styled-git-log)
4949
- [Git Query](#git-query)
5050
- [Merged Branches](#merged-branches)
51+
- [Fixup and Autosquash](#fixup-and-autosquash)
5152
- [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories)
5253
- [Git Configurations](#git-configurations)
5354
- [Aliases](#aliases)
@@ -637,6 +638,15 @@ Will give you a list of branches that have not been merged into your current bra
637638

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

641+
### Fixup and Autosquash
642+
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:
643+
```bash
644+
$ git commit --fixup=abcde
645+
$ git rebase abcde^ --autosquash -i
646+
```
647+
[*Read more about the Git `commit` command.*](http://git-scm.com/docs/git-commit)
648+
[*Read more about the Git `rebase` command.*](http://git-scm.com/docs/git-rebase)
649+
640650
### Web Server for Browsing Local Repositories
641651
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.
642652

0 commit comments

Comments
 (0)
0