|
@@ -1,3 +1,19 @@
|
|
-git add .
|
|
|
|
-git commit -m "$(date +%Y-%m-%d.%H:%M:%S)"
|
|
|
|
-git push
|
|
|
|
|
|
+#!/bin/bash
|
|
|
|
+
|
|
|
|
+# 添加所有已修改的文件
|
|
|
|
+git add -u
|
|
|
|
+
|
|
|
|
+# 获取当前日期和时间
|
|
|
|
+current_date=$(date "+%Y-%m-%d %H:%M:%S")
|
|
|
|
+
|
|
|
|
+# 获取已修改的文件名
|
|
|
|
+modified_files=$(git diff --name-only --cached)
|
|
|
|
+
|
|
|
|
+# 构建提交信息
|
|
|
|
+commit_message="$current_date $modified_files"
|
|
|
|
+
|
|
|
|
+# 提交更改
|
|
|
|
+git commit -m "$commit_message"
|
|
|
|
+
|
|
|
|
+# 推送到远程仓库
|
|
|
|
+git push
|