sync: 2026-09-01 21:33
This commit is contained in:
1 parent
e605c8e827
commit
385a84ee22
2 files changed
+16
-13
No files matched your search
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /home/benji/Documents/COURS || exit
|
||||
|
||||
git fetch
|
||||
git pull
|
||||
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /home/benji/Documents/COURS || exit
|
||||
TARGET_DIR="$HOME/Documents/COURS"
|
||||
|
||||
./grab.sh
|
||||
# Navigate to target directory
|
||||
cd "$TARGET_DIR" || { echo "Directory not found"; exit 1; }
|
||||
|
||||
git add .
|
||||
git commit -m "$(date +'%d/%m')"
|
||||
git push
|
||||
# Pull remote changes rebase-style to prevent messy merge commits
|
||||
git pull --rebase --autostash || { echo "Git pull failed"; exit 1; }
|
||||
|
||||
# Stage all files
|
||||
git add -A
|
||||
|
||||
# Commit only if there are actual changes staged
|
||||
if ! git diff-index --quiet HEAD --; then
|
||||
git commit -m "sync: $(date +'%Y-%m-%d %H:%M')"
|
||||
git push || { echo "Git push failed"; exit 1; }
|
||||
else
|
||||
echo "No changes to commit."
|
||||
fi
|
||||
Reference in new issue
Block a user