Skip to content

Commit bab8fc4

Browse files
committed
屏蔽《回退到指定的提交上》脚本打印的多余内容
1 parent f6a6abb commit bab8fc4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shell/git-tools/commit/revert/ResetToCommit.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# author : Android 轮子哥
44
# github : https://github.com/getActivity/AndroidCmdTools
55
# time : 2026/01/25
6-
# desc : Git 重置到提交脚本(硬重置到指定 commit)
6+
# desc : Git 重置提交脚本
77
# ----------------------------------------------------------------------
88
scriptDirPath=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
99
[ -z "" ] || source "../../../common/SystemPlatform.sh"
@@ -82,10 +82,10 @@ main() {
8282
fi
8383
exit 0
8484
elif [[ "${resultChoice}" == "2" ]]; then
85-
(cd "${repositoryDirPath}" && git reset --hard "${origHead}")
85+
(cd "${repositoryDirPath}" && git reset --hard "${origHead}") < /dev/null > /dev/null
8686
finalHash=$(cd "${repositoryDirPath}" && git rev-parse HEAD)
8787
if [[ "${finalHash}" == "${origHead}" ]]; then
88-
(cd "${repositoryDirPath}" && git branch -D "${backupBranch}") 2>&1 || true
88+
(cd "${repositoryDirPath}" && git branch -D "${backupBranch}") < /dev/null > /dev/null || true
8989
echo "✅ 已经还原到最初的状态,并已删除备份分支 ${backupBranch}"
9090
exit 0
9191
else

0 commit comments

Comments
 (0)