update
This commit is contained in:
40
push.sh
40
push.sh
@@ -1,55 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script pour automatiser git add, commit et push
|
||||
# Usage: ./git-commit.sh "votre message de commit"
|
||||
# Script to automate git add, commit and push
|
||||
# Usage: ./push.sh "your commit message"
|
||||
|
||||
# Vérifier si un message de commit a été fourni
|
||||
# Check if a commit message has been provided
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Erreur: Veuillez fournir un message de commit."
|
||||
echo "Usage: ./git-commit.sh \"votre message de commit\""
|
||||
echo "Error: Please provide a commit message."
|
||||
echo "Usage: ./push.sh \"your commit message\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Récupérer le message de commit depuis les arguments
|
||||
# Get the commit message from arguments
|
||||
COMMIT_MESSAGE="$1"
|
||||
|
||||
echo "Exécution des commandes git..."
|
||||
echo "Executing git commands..."
|
||||
echo "----------------------------------------"
|
||||
|
||||
# git add .
|
||||
echo "1. Ajout de tous les fichiers (git add .)"
|
||||
echo "1. Adding all files (git add .)"
|
||||
git add .
|
||||
|
||||
# Vérifier si git add a réussi
|
||||
# Check if git add succeeded
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✓ git add . - Succès"
|
||||
echo "✓ git add . - Success"
|
||||
else
|
||||
echo "✗ git add . - Échec"
|
||||
echo "✗ git add . - Failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# git commit
|
||||
echo "2. Commit avec le message: \"$COMMIT_MESSAGE\""
|
||||
echo "2. Committing with message: \"$COMMIT_MESSAGE\""
|
||||
git commit -m "$COMMIT_MESSAGE"
|
||||
|
||||
# Vérifier si git commit a réussi
|
||||
# Check if git commit succeeded
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✓ git commit - Succès"
|
||||
echo "✓ git commit - Success"
|
||||
else
|
||||
echo "✗ git commit - Échec"
|
||||
echo "✗ git commit - Failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# git push
|
||||
echo "3. Push vers le repository distant"
|
||||
echo "3. Pushing to remote repository"
|
||||
git push
|
||||
|
||||
# Vérifier si git push a réussi
|
||||
# Check if git push succeeded
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✓ git push - Succès"
|
||||
echo "✓ git push - Success"
|
||||
echo "----------------------------------------"
|
||||
echo "Toutes les opérations git ont été effectuées avec succès !"
|
||||
echo "All git operations completed successfully!"
|
||||
else
|
||||
echo "✗ git push - Échec"
|
||||
echo "✗ git push - Failed"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user