1 Star 0 Fork 0

sunxinglove/lark

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
git-push.sh 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
saeipi 提交于 2024-05-27 09:30 +08:00 . update module
#!/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.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sunxinglove/lark.git
[email protected]:sunxinglove/lark.git
sunxinglove
lark
lark
main

搜索帮助