Skip to content

Commit dc14c06

Browse files
committed
Add 'Make git-retry': pushes latest commit with new SHA to get new preview build
1 parent bab60d3 commit dc14c06

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/current/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,19 @@ clean-site:
103103

104104
clean-cache:
105105
rm -rf .jekyll-cache
106+
107+
.PHONY: git-retry
108+
git-retry:
109+
@echo "This will replace the last commit on the remote branch with an identical one,"
110+
@echo "except for its timestamp and SHA, to kick off a new preview build."
111+
@read -p "Proceed? (y/N): " confirm && \
112+
if [ "$$confirm" = "y" ] || [ "$$confirm" = "Y" ]; then \
113+
BRANCH=$$(git rev-parse --abbrev-ref HEAD); \
114+
echo "Working on branch: $$BRANCH"; \
115+
git pull && \
116+
git commit --amend --no-edit --allow-empty && \
117+
git push --force origin $$BRANCH && \
118+
echo "✓ Successfully pushed amended commit to $$BRANCH"; \
119+
else \
120+
echo "Aborted."; \
121+
fi

0 commit comments

Comments
 (0)