Skip to content

Commit cba3a0c

Browse files
committed
Update reset_branch.sh
1 parent fc2dade commit cba3a0c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

reset_branch.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ current_branch=$(git rev-parse --abbrev-ref HEAD)
1010
temp_branch="${current_branch}_temp"
1111
git checkout -b $temp_branch
1212

13-
# Get all commit hashes
14-
commits=$(git log --format=%H)
13+
# Get the starting commit
14+
start_commit="91ac6c5366d02d9f906d5e25463c7f3edae6f165"
1515

16-
# Iterate through commits in reverse order
16+
# Get all commit hashes from the starting commit to HEAD
17+
commits=$(git rev-list --reverse $start_commit..HEAD)
18+
19+
# Iterate through commits
1720
for commit in $commits; do
1821
# Check if the commit is a merge commit
1922
if [ $(git rev-parse $commit^2 2>/dev/null) ]; then

0 commit comments

Comments
 (0)