Update documentation - 2025-07-14 16:41
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9552cfbe4e
commit
124336e65f
3 changed files with 55 additions and 9 deletions
24
git_push.sh
24
git_push.sh
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
set -e # Exit on any error
|
||||
|
||||
# Create log file with timestamp
|
||||
LOG_FILE="git_push.log"
|
||||
echo "=== Git Push Log - $(date) ===" >> "$LOG_FILE"
|
||||
|
||||
# Colors for output
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
|
|
@ -15,12 +19,14 @@ echo -e "${BLUE}🚀 Smart Git Push${NC}"
|
|||
# Check if we're in a git repo
|
||||
if ! git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
echo -e "${RED}❌ Not in a git repository${NC}"
|
||||
echo "ERROR: Not in a git repository" >> "$LOG_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if there are any changes (including untracked files)
|
||||
if git diff --quiet && git diff --staged --quiet && [ -z "$(git ls-files --others --exclude-standard)" ]; then
|
||||
echo -e "${GREEN}✅ No changes to commit${NC}"
|
||||
echo "INFO: No changes to commit" >> "$LOG_FILE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
@ -78,20 +84,28 @@ COMMIT_MSG="$COMMIT_MSG
|
|||
|
||||
Co-Authored-By: Claude <noreply@anthropic.com>"
|
||||
|
||||
# Log the operation details
|
||||
echo "Files changed: $MODIFIED_FILES" >> "$LOG_FILE"
|
||||
echo "Commit message: $COMMIT_MSG" >> "$LOG_FILE"
|
||||
|
||||
# Stage all changes
|
||||
echo -e "${BLUE}📦 Staging changes...${NC}"
|
||||
git add .
|
||||
git add . 2>> "$LOG_FILE"
|
||||
|
||||
# Commit
|
||||
echo -e "${BLUE}💾 Committing: $COMMIT_MSG${NC}"
|
||||
git commit -m "$COMMIT_MSG" > /dev/null
|
||||
echo -e "${BLUE}💾 Committing...${NC}"
|
||||
git commit -m "$COMMIT_MSG" >> "$LOG_FILE" 2>&1
|
||||
|
||||
# Push
|
||||
echo -e "${BLUE}⬆️ Pushing to origin...${NC}"
|
||||
git push origin main > /dev/null 2>&1
|
||||
git push origin main >> "$LOG_FILE" 2>&1
|
||||
|
||||
echo -e "${GREEN}✅ Successfully pushed to git!${NC}"
|
||||
|
||||
# Show summary (minimal)
|
||||
CHANGED_COUNT=$(echo "$MODIFIED_FILES" | wc -l)
|
||||
echo -e "${GREEN}📊 Pushed $CHANGED_COUNT file(s)${NC}"
|
||||
echo -e "${GREEN}📊 Pushed $CHANGED_COUNT file(s)${NC}"
|
||||
|
||||
# Log success
|
||||
echo "SUCCESS: Push completed at $(date)" >> "$LOG_FILE"
|
||||
echo "" >> "$LOG_FILE"
|
||||
Loading…
Add table
Add a link
Reference in a new issue