Skip to content

Commit 8cd2b3a

Browse files
committed
fix: Support branches other than master, closes #1
1 parent f0ebca3 commit 8cd2b3a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# git squash [![Maintenance](https://img.shields.io/maintenance/yes/2020.svg?maxAge=2592000)]()
44

5-
Locally squash commits on a branch without needing to resolve any conflicts.
5+
Locally squash commits on a branch without resolving any conflicts.
66

77
It works just like GitHub's "Squash and merge" or GitLab's "Squash commits".
88

git-squash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if ! git show-ref "$1" > /dev/null; then
2525
exit 1
2626
fi
2727

28-
FIRST_COMMIT_ID=$(git log master.. --no-merges --pretty=format:%h | tail -1)
28+
FIRST_COMMIT_ID=$(git log $1.. --no-merges --pretty=format:%h | tail -1)
2929

3030
if [ "$FIRST_COMMIT_ID" == "" ]; then
3131
echo "There are no changes to be squashed"

0 commit comments

Comments
 (0)