代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
read -p "Input commit message: " commit_msg
if [ -z "$commit_msg" ]; then
echo "commit message is empty"
exit 1
fi
git add .
git commit -m "$commit_msg"
current_branch=$(git symbolic-ref --short HEAD)
echo "current branch: $current_branch"
git pull origin $current_branch
if [ $? -ne 0 ]; then
echo "pull failed"
exit 1
fi
git push origin $current_branch
if [ $? -ne 0 ]; then
echo "push failed"
exit 1
fi
#hint: You have divergent branches and need to specify how to reconcile them.
#hint: You can do so by running one of the following commands sometime before
#hint: your next pull:
#hint:
#hint: git config pull.rebase false # merge
#hint: git config pull.rebase true # rebase
#hint: git config pull.ff only # fast-forward only
#hint:
#hint: You can replace "git config" with "git config --global" to set a default
#hint: preference for all repositories. You can also pass --rebase, --no-rebase,
#hint: or --ff-only on the command line to override the configured default per
#hint: invocation.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。