代码拉取完成,页面将自动刷新
#!/bin/bash
# 远程仓库分支名称
remote_github="github"
remote_gitee="origin"
branch="master"
# 是否需要添加所有更改
read -p "Do you want to add all changes and commit? [y/n]: " is_add
# 根据输入确认是否默认提交
if [ "$is_add" == "y" ] || [ "$is_add" == "Y" ]; then
echo "Add all changes and commit"
git add .
# 获取提交信息
read -p "Please enter the commit information: " msg
# 提交所有更改
echo "Commit all changes with message: $msg"
git commit -m "$msg"
else
echo "Skip add all changes and commit"
fi
# 推送到gitee
echo "Push to gitee"
git push -u $remote_gitee $branch
# 推送到github
echo "Push to github"
git push -u $remote_github $branch:main --tags
echo "Push to github and gitee successfully"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。