mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Added git-squash
This commit is contained in:
parent
391431d267
commit
902996edd2
|
|
@ -25,6 +25,7 @@ $ brew install git-extras
|
|||
## Commands
|
||||
|
||||
- `git extras`
|
||||
- `git squash`
|
||||
- `git summary`
|
||||
- `git changelog`
|
||||
- `git commits-since`
|
||||
|
|
@ -202,6 +203,10 @@ $ git commits-since yesterday
|
|||
TJ Holowaychuk - Fixed readme
|
||||
```
|
||||
|
||||
## git-squash [msg]
|
||||
|
||||
Squashes the current branch into a single commit with the given `[msg]`.
|
||||
|
||||
## git-count
|
||||
|
||||
Output commit count:
|
||||
|
|
|
|||
10
bin/git-squash
Executable file
10
bin/git-squash
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
# TODO: warn on master
|
||||
|
||||
branch=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
|
||||
msg=${1-Squashed $branch}
|
||||
git checkout -b squash-tmp master \
|
||||
&& git merge --squash $branch \
|
||||
&& git commit -m $msg \
|
||||
&& git branch -M $branch
|
||||
Loading…
Reference in a new issue