gpt4 book ai didi

git - 如何重置为特定的提交?

转载 作者:太空狗 更新时间:2023-10-29 13:48:04 28 4
gpt4 key购买 nike

当我执行“git log --oneline”时,我有以下最近的提交...我想重置为“8ec2027”,我尝试了一些不起作用的 rebase 命令..执行此操作的确切命令是什么?

2503013 code: cs release 1.2.3.47
269ed14 code: Fixed below issues due to which 2nd client is not associating to GO
dca02a3 code: Donot allow the scan during WPS/EAPOL exchange.
b2fee57 code: MCC Adaptive Scheduler
6af29c4 code: Not able to connect more then 10 STA
150aacd code: Fix the Max Tx power value in 5G band and .ini support for 11h
8ec2027 Merge "code: cs release 1.2.3.46"
9015b60 Merge "code: Quarky Support on Prima"
......

最佳答案

你想重置而不是 rebase 。 rebase 是重放提交的行为。重置是将当前提交变成其他提交。

您需要先保存工作目录中的所有工作:

 git stash -u

然后你会让你当前提交你想要的那个

git reset --hard 8ec2027

可选地,在你可以保存你在执行此操作之前的位置之后:

git branch -b temp HEAD@{1}

查看 reflog 文档以了解其工作原理。

关于git - 如何重置为特定的提交?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14314596/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com