Compare commits
83 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bf705674d5 | |||
| fee369a503 | |||
| ad75818566 | |||
| 65f2c8610d | |||
| 517128fd99 | |||
| 55c8384a25 | |||
| 0064122eff | |||
| 0c783c66d0 | |||
| 47e2351dab | |||
| e1aca6b00c | |||
| 2cb6577f26 | |||
| c51d756503 | |||
| c48b9780df | |||
| 618e2695fd | |||
| a289f97a31 | |||
| 7387a5e9f9 | |||
| 4615a5d795 | |||
| f926cd3adf | |||
| 96b05b5e0c | |||
| 99e47785e4 | |||
| 94f10e1645 | |||
| fe4a476e41 | |||
| e9f92e66d0 | |||
| 58f4217756 | |||
| 76a466c077 | |||
| 9dc3777985 | |||
| e006d73831 | |||
| 63e88c8324 | |||
| 105167fb57 | |||
| 22cc40617f | |||
| 7f28917795 | |||
| 77af2a8415 | |||
| 4c42b4c601 | |||
| 856cdc214c | |||
| 15b244292f | |||
| 558a966f85 | |||
| 1238db58c2 | |||
| 0502ed34c9 | |||
| 1f417c7e30 | |||
| a401fbdc54 | |||
| 247e154afe | |||
| cbfd84ddea | |||
| dc1419c051 | |||
| 2624ea6130 | |||
| 08eeac66eb | |||
| 11769219e4 | |||
| 7750170832 | |||
| 833591681a | |||
| b77e60c37c | |||
| 30f6780484 | |||
| aa39e132aa | |||
| f6a79c815e | |||
| 3c6837bd90 | |||
| 62dcaf8555 | |||
| 4ed35f1b16 | |||
| 5eff7dd4a6 | |||
| abbcdb1113 | |||
| 17fc40e65d | |||
| a54a2c0fda | |||
| febacb79ad | |||
| c7875102c5 | |||
| 3dc013d7b1 | |||
| b7c8953cb4 | |||
| d6adde4e09 | |||
| 0bf4764a07 | |||
| 08da01f021 | |||
| b4b09c1650 | |||
| b2ae5f18ad | |||
| 4a7a3bba07 | |||
| b3f240b2a5 | |||
| ba0bf11a1d | |||
| d5790ad635 | |||
| e6757bd51b | |||
| 8588133a4e | |||
| 4b18077573 | |||
| c584369d5d | |||
| 95939d57e6 | |||
| be58146dc7 | |||
| 45ce98806d | |||
| 23b7a848ab | |||
| 0fe6d738b2 | |||
| 3f73d44c5a | |||
| 1773ed5f95 |
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "picpeak-backend",
|
"name": "picpeak-backend",
|
||||||
"version": "1.0.94",
|
"version": "1.0.93",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "picpeak-backend",
|
"name": "picpeak-backend",
|
||||||
"version": "1.0.94",
|
"version": "1.0.93",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.850.0",
|
"@aws-sdk/client-s3": "^3.850.0",
|
||||||
"@aws-sdk/lib-storage": "^3.850.0",
|
"@aws-sdk/lib-storage": "^3.850.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "picpeak-backend",
|
"name": "picpeak-backend",
|
||||||
"version": "1.0.94",
|
"version": "1.0.93",
|
||||||
"description": "Backend for PicPeak event photo sharing platform",
|
"description": "Backend for PicPeak event photo sharing platform",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Executable
+163
@@ -0,0 +1,163 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script to clean git history - removes all commits before July 17, 2025
|
||||||
|
# Safe version: Moves current main to main-old and creates new clean main
|
||||||
|
# WARNING: This will rewrite history!
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "⚠️ WARNING: This script will rewrite git history!"
|
||||||
|
echo "⚠️ All commits before July 17, 2025 will be removed."
|
||||||
|
echo "⚠️ Current main branch will be preserved as main-old"
|
||||||
|
echo ""
|
||||||
|
read -p "Are you sure you want to continue? (type 'yes' to proceed): " confirmation
|
||||||
|
|
||||||
|
if [ "$confirmation" != "yes" ]; then
|
||||||
|
echo "Operation cancelled."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check current state
|
||||||
|
CURRENT_BRANCH=$(git branch --show-current)
|
||||||
|
echo "Current branch: $CURRENT_BRANCH"
|
||||||
|
|
||||||
|
# Check if we're in the middle of a cherry-pick or rebase
|
||||||
|
if [ -d ".git/CHERRY_PICK_HEAD" ] || [ -d ".git/rebase-merge" ] || [ -d ".git/rebase-apply" ]; then
|
||||||
|
echo "ERROR: You're in the middle of a cherry-pick or rebase. Please resolve or abort it first."
|
||||||
|
echo "To abort cherry-pick: git cherry-pick --abort"
|
||||||
|
echo "To abort rebase: git rebase --abort"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Clean any previous attempts
|
||||||
|
echo "Cleaning up any previous attempts..."
|
||||||
|
git cherry-pick --abort 2>/dev/null || true
|
||||||
|
git rebase --abort 2>/dev/null || true
|
||||||
|
|
||||||
|
# Check if main-old already exists
|
||||||
|
if git show-ref --verify --quiet refs/heads/main-old; then
|
||||||
|
echo ""
|
||||||
|
echo "⚠️ Branch 'main-old' already exists!"
|
||||||
|
echo "Options:"
|
||||||
|
echo "1. Delete it and continue (previous backup will be lost)"
|
||||||
|
echo "2. Rename it with timestamp and continue"
|
||||||
|
echo "3. Cancel operation"
|
||||||
|
read -p "Choose option (1/2/3): " option
|
||||||
|
|
||||||
|
case $option in
|
||||||
|
1)
|
||||||
|
echo "Deleting existing main-old branch..."
|
||||||
|
git branch -D main-old
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
|
||||||
|
NEW_NAME="main-old-${TIMESTAMP}"
|
||||||
|
echo "Renaming existing main-old to ${NEW_NAME}..."
|
||||||
|
git branch -m main-old "${NEW_NAME}"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
echo "Operation cancelled."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid option. Operation cancelled."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Make sure we're on main branch
|
||||||
|
if [ "$CURRENT_BRANCH" != "main" ]; then
|
||||||
|
echo "Switching to main branch..."
|
||||||
|
git checkout main
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Move current main to main-old
|
||||||
|
echo "Moving current main branch to main-old..."
|
||||||
|
git branch -m main main-old
|
||||||
|
|
||||||
|
# Find the first commit on or after July 17, 2025
|
||||||
|
echo "Finding first commit after July 17, 2025..."
|
||||||
|
FIRST_COMMIT=$(git log --since="2025-07-17" --reverse --format="%H" | head -1)
|
||||||
|
|
||||||
|
if [ -z "$FIRST_COMMIT" ]; then
|
||||||
|
echo "ERROR: No commits found after July 17, 2025"
|
||||||
|
# Restore main branch
|
||||||
|
git branch -m main-old main
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "First commit to keep: $FIRST_COMMIT"
|
||||||
|
echo "Commit details: $(git log --oneline -1 $FIRST_COMMIT)"
|
||||||
|
|
||||||
|
# Count total commits to process
|
||||||
|
TOTAL_COMMITS=$(git log --since="2025-07-17" --oneline | wc -l)
|
||||||
|
echo "Total commits to preserve: $TOTAL_COMMITS"
|
||||||
|
|
||||||
|
# Create new orphan branch for clean main
|
||||||
|
echo "Creating new clean main branch..."
|
||||||
|
git checkout --orphan main
|
||||||
|
|
||||||
|
# Clean the working directory
|
||||||
|
git rm -rf . || true
|
||||||
|
|
||||||
|
# Get the tree from the first commit
|
||||||
|
git checkout $FIRST_COMMIT -- .
|
||||||
|
|
||||||
|
# Create new initial commit with same content
|
||||||
|
ORIGINAL_MESSAGE=$(git log --format="%B" -1 $FIRST_COMMIT)
|
||||||
|
ORIGINAL_AUTHOR=$(git log --format="%an <%ae>" -1 $FIRST_COMMIT)
|
||||||
|
ORIGINAL_DATE=$(git log --format="%ad" -1 $FIRST_COMMIT)
|
||||||
|
|
||||||
|
GIT_AUTHOR_NAME=$(echo "$ORIGINAL_AUTHOR" | cut -d'<' -f1 | xargs)
|
||||||
|
GIT_AUTHOR_EMAIL=$(echo "$ORIGINAL_AUTHOR" | cut -d'<' -f2 | cut -d'>' -f1)
|
||||||
|
GIT_AUTHOR_DATE="$ORIGINAL_DATE"
|
||||||
|
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
|
||||||
|
|
||||||
|
git add -A
|
||||||
|
git commit -m "Initial commit - Project start (July 17, 2025)
|
||||||
|
|
||||||
|
Original: $ORIGINAL_MESSAGE"
|
||||||
|
|
||||||
|
# Now rebase the rest of the history onto the new main
|
||||||
|
echo "Rebasing remaining commits..."
|
||||||
|
echo "This will linearize the history (merge commits will be flattened)..."
|
||||||
|
|
||||||
|
# Use rebase to apply all commits
|
||||||
|
git rebase --onto main $FIRST_COMMIT main-old || {
|
||||||
|
echo ""
|
||||||
|
echo "⚠️ Rebase encountered conflicts!"
|
||||||
|
echo ""
|
||||||
|
echo "To resolve:"
|
||||||
|
echo "1. Fix the conflicts in the listed files"
|
||||||
|
echo "2. Stage the resolved files: git add <files>"
|
||||||
|
echo "3. Continue rebase: git rebase --continue"
|
||||||
|
echo "4. If you want to abort and restore: git rebase --abort && git branch -D main && git branch -m main-old main"
|
||||||
|
echo ""
|
||||||
|
echo "After successful rebase, your main branch will have the clean history."
|
||||||
|
echo "The old history is preserved in main-old branch."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# If we get here, rebase was successful
|
||||||
|
echo ""
|
||||||
|
echo "✅ New clean history created successfully!"
|
||||||
|
echo "Total commits in new history: $(git rev-list --count HEAD)"
|
||||||
|
echo ""
|
||||||
|
echo "Branch status:"
|
||||||
|
echo " - main: Clean history starting from July 17, 2025"
|
||||||
|
echo " - main-old: Original history with all commits"
|
||||||
|
echo ""
|
||||||
|
echo "To push the new history to remote, run:"
|
||||||
|
echo " git push origin main --force"
|
||||||
|
echo ""
|
||||||
|
echo "To also push the old history backup:"
|
||||||
|
echo " git push origin main-old"
|
||||||
|
echo ""
|
||||||
|
echo "⚠️ WARNING: Force pushing will overwrite the remote repository!"
|
||||||
|
echo "⚠️ Make sure all team members are aware before pushing!"
|
||||||
|
echo ""
|
||||||
|
echo "If you need to restore the original history:"
|
||||||
|
echo " git checkout main-old"
|
||||||
|
echo " git branch -D main"
|
||||||
|
echo " git branch -m main"
|
||||||
Executable
+123
@@ -0,0 +1,123 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script to clean git history - removes all commits before July 17, 2025
|
||||||
|
# Version 2: Handles merge commits properly
|
||||||
|
# WARNING: This is destructive and will rewrite history!
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "⚠️ WARNING: This script will permanently rewrite git history!"
|
||||||
|
echo "⚠️ All commits before July 17, 2025 will be removed."
|
||||||
|
echo "⚠️ This action cannot be undone!"
|
||||||
|
echo ""
|
||||||
|
read -p "Are you sure you want to continue? (type 'yes' to proceed): " confirmation
|
||||||
|
|
||||||
|
if [ "$confirmation" != "yes" ]; then
|
||||||
|
echo "Operation cancelled."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check current state
|
||||||
|
CURRENT_BRANCH=$(git branch --show-current)
|
||||||
|
echo "Current branch: $CURRENT_BRANCH"
|
||||||
|
|
||||||
|
# Check if we're in the middle of a cherry-pick
|
||||||
|
if [ -d ".git/CHERRY_PICK_HEAD" ]; then
|
||||||
|
echo "ERROR: You're in the middle of a cherry-pick. Please resolve or abort it first."
|
||||||
|
echo "To abort: git cherry-pick --abort"
|
||||||
|
echo "To continue: git cherry-pick --continue"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Clean any previous attempts
|
||||||
|
echo "Cleaning up any previous attempts..."
|
||||||
|
git cherry-pick --abort 2>/dev/null || true
|
||||||
|
git checkout main 2>/dev/null || true
|
||||||
|
git branch -D new-main 2>/dev/null || true
|
||||||
|
|
||||||
|
# Create backup branch
|
||||||
|
echo "Creating backup branch..."
|
||||||
|
BACKUP_BRANCH="backup-before-cleanup-$(date +%Y%m%d-%H%M%S)"
|
||||||
|
git checkout -b "$BACKUP_BRANCH"
|
||||||
|
git checkout main
|
||||||
|
|
||||||
|
# Find the first commit on or after July 17, 2025
|
||||||
|
echo "Finding first commit after July 17, 2025..."
|
||||||
|
FIRST_COMMIT=$(git log --since="2025-07-17" --reverse --format="%H" | head -1)
|
||||||
|
|
||||||
|
if [ -z "$FIRST_COMMIT" ]; then
|
||||||
|
echo "ERROR: No commits found after July 17, 2025"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "First commit to keep: $FIRST_COMMIT"
|
||||||
|
echo "Commit details: $(git log --oneline -1 $FIRST_COMMIT)"
|
||||||
|
|
||||||
|
# Count total commits to process
|
||||||
|
TOTAL_COMMITS=$(git log --since="2025-07-17" --oneline | wc -l)
|
||||||
|
echo "Total commits to preserve: $TOTAL_COMMITS"
|
||||||
|
|
||||||
|
# Create new orphan branch
|
||||||
|
echo "Creating new clean history..."
|
||||||
|
git checkout --orphan new-main
|
||||||
|
|
||||||
|
# Clean the working directory
|
||||||
|
git rm -rf . || true
|
||||||
|
|
||||||
|
# Get the tree from the first commit
|
||||||
|
git checkout $FIRST_COMMIT -- .
|
||||||
|
|
||||||
|
# Create new initial commit with same content
|
||||||
|
ORIGINAL_MESSAGE=$(git log --format="%B" -1 $FIRST_COMMIT)
|
||||||
|
ORIGINAL_AUTHOR=$(git log --format="%an <%ae>" -1 $FIRST_COMMIT)
|
||||||
|
ORIGINAL_DATE=$(git log --format="%ad" -1 $FIRST_COMMIT)
|
||||||
|
|
||||||
|
GIT_AUTHOR_NAME=$(echo "$ORIGINAL_AUTHOR" | cut -d'<' -f1 | xargs)
|
||||||
|
GIT_AUTHOR_EMAIL=$(echo "$ORIGINAL_AUTHOR" | cut -d'<' -f2 | cut -d'>' -f1)
|
||||||
|
GIT_AUTHOR_DATE="$ORIGINAL_DATE"
|
||||||
|
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
|
||||||
|
|
||||||
|
git add -A
|
||||||
|
git commit -m "Initial commit - Project start (July 17, 2025)
|
||||||
|
|
||||||
|
Original: $ORIGINAL_MESSAGE"
|
||||||
|
|
||||||
|
# Now we'll use git rebase instead of cherry-pick to handle merges better
|
||||||
|
echo "Rebasing remaining commits..."
|
||||||
|
echo "This will linearize the history (merge commits will be flattened)..."
|
||||||
|
|
||||||
|
# Get the commit range
|
||||||
|
LAST_COMMIT=$(git rev-parse main)
|
||||||
|
|
||||||
|
# Use rebase to apply all commits
|
||||||
|
git rebase --onto new-main $FIRST_COMMIT main || {
|
||||||
|
echo ""
|
||||||
|
echo "⚠️ Rebase encountered conflicts!"
|
||||||
|
echo ""
|
||||||
|
echo "To resolve:"
|
||||||
|
echo "1. Fix the conflicts in the listed files"
|
||||||
|
echo "2. Stage the resolved files: git add <files>"
|
||||||
|
echo "3. Continue rebase: git rebase --continue"
|
||||||
|
echo "4. If you want to abort: git rebase --abort"
|
||||||
|
echo ""
|
||||||
|
echo "After successful rebase, run:"
|
||||||
|
echo " git branch -D main"
|
||||||
|
echo " git branch -m main"
|
||||||
|
echo " git push origin main --force"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# If we get here, rebase was successful
|
||||||
|
echo ""
|
||||||
|
echo "✅ New history created successfully!"
|
||||||
|
echo "Total commits in new history: $(git rev-list --count HEAD)"
|
||||||
|
echo ""
|
||||||
|
echo "Your backup branch is: $BACKUP_BRANCH"
|
||||||
|
echo ""
|
||||||
|
echo "To finalize the cleanup, run these commands:"
|
||||||
|
echo " git branch -D main"
|
||||||
|
echo " git branch -m main"
|
||||||
|
echo " git push origin main --force"
|
||||||
|
echo ""
|
||||||
|
echo "⚠️ WARNING: Force pushing will overwrite the remote repository!"
|
||||||
|
echo "⚠️ Make sure you have a backup and all team members are aware!"
|
||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "picpeak-frontend",
|
"name": "picpeak-frontend",
|
||||||
"version": "1.0.94",
|
"version": "1.0.93",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "picpeak-frontend",
|
"name": "picpeak-frontend",
|
||||||
"version": "1.0.94",
|
"version": "1.0.93",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tanstack/react-query": "^5.0.0",
|
"@tanstack/react-query": "^5.0.0",
|
||||||
"@tiptap/extension-character-count": "^2.26.1",
|
"@tiptap/extension-character-count": "^2.26.1",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "picpeak-frontend",
|
"name": "picpeak-frontend",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.94",
|
"version": "1.0.93",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
Reference in New Issue
Block a user