2025-06-06 13:41:48 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
cd ~/ros2_ws || exit 1
|
|
|
|
|
|
|
|
|
|
# 获取当前时间作为提交信息
|
|
|
|
|
commit_time=$(date "+%Y-%m-%d %H:%M:%S")
|
|
|
|
|
|
|
|
|
|
# 添加除该脚本以外的所有更改文件
|
|
|
|
|
git add .
|
|
|
|
|
|
|
|
|
|
# 移除对本脚本的暂存
|
|
|
|
|
git reset HEAD auto_git_push.sh
|
2025-06-06 13:48:52 +08:00
|
|
|
git reset HEAD build/
|
|
|
|
|
git reset HEAD install/
|
|
|
|
|
git reset HEAD log/
|
2025-06-06 13:41:48 +08:00
|
|
|
|
|
|
|
|
# 提交
|
|
|
|
|
git commit -m "Auto commit at $commit_time"
|
|
|
|
|
|
|
|
|
|
# 推送到远程仓库
|
2025-06-06 13:42:14 +08:00
|
|
|
git push origin main
|