feedforward 发表于 2022-6-5 22:15:31

github回退定位问题

本地自己提交很多次后出现问题:

通过git reflog命令列出所有本地提交记录,如下所示:

dd7e981 HEAD@{0}: checkout: moving from master to fft
dd7e981 HEAD@{1}: pull upstream master: Fast-forward
3afd123 HEAD@{2}: checkout: moving from fft to master
e04183a HEAD@{3}: commit (amend): industry/foc foc_ident: adding flux linkage identification
946afaa HEAD@{4}: rebase -i (finish): returning to refs/heads/fft
946afaa HEAD@{5}: rebase -i (squash): industry/foc foc_ident: adding flux linkage identification
92c36a8 HEAD@{6}: rebase -i (start): checkout HEAD~3
827ee55 HEAD@{7}: commit: industry/foc foc_ident: adding flux linkage identification
92c36a8 HEAD@{8}: commit (amend): industry/foc foc_ident: adding flux linkage identification
f7ad666 HEAD@{9}: rebase -i (finish): returning to refs/heads/fft
f7ad666 HEAD@{10}: rebase -i (squash): industry/foc foc_ident: adding flux linkage identification
13ca67f HEAD@{11}: rebase -i (start): checkout HEAD~3
1280759 HEAD@{12}: commit: industry/foc foc_ident: adding flux linkage identification
13ca67f HEAD@{13}: commit (amend): industry/foc foc_ident: adding flux linkage identification
b1ff3cb HEAD@{14}: rebase -i (finish): returning to refs/heads/fft
b1ff3cb HEAD@{15}: rebase -i (squash): industry/foc foc_ident: adding flux linka:...skipping...

比如说要回退到13ca67f HEAD@{13}: commit (amend): industry/foc foc_ident: adding flux linkage identification用如下命令:
git reset --hard 13ca67f

远程线上别人提交很多次后出问题通过git log --oneline 命令列出所有线上提交记录,如下所示:

f77a0ec arch: Move -finstrument-functions from Make.defs to Toolchain.defs
1fde7e1 arch: Move -fstack-protector-all from Make.defs to Toolchain.defs
aeb9c5d boards: Move -fno-strict-aliasing from Make.defs to Toolchain.defs
1e23799 arch/riscv: Optimize the syscall performance in kernel mode
efce8bd Revert "arch/risc-v: use STACK_FRAME_SIZE for in S-mode syscall asm"
a021177 arch: Fix the style found in review
4a03cab libc: Remove the redundant seek in writev
220f1dd boards: run tools/refresh.sh to normalize defconfig
05ff19d tools/testbuild.sh: Don't skip configure and distclean
5db4476 arm/cxd56xx/lc823450/rp2040: replace arch testset to board implement
3ec2f70 arch/arm/Make.defs: unify arch common source include
8951b01 arch/cortex-/Make.defs: unify arch common source include
5677fe2 arch/cortex-m/Make.defs: unify arch common source include
a560eb5 arch/arm/Make.defs: unify common source include
2a95be5 arch/avr: Remvoe the error message when toolchain can't find
baf852f tools/ci: Enable libcxx test config
b12c0a1 boards: Remove -std=c++1x from Make.defs
7f91fcd boards/arm: Remove the unneeded C++ config from stm32l4/nucleo-l476rg


比如说要回退到a560eb5 arch/arm/Make.defs: unify common source include用如下命令:
git reset --hard a560eb5


通过二分法回退测试,直到定位到具体哪次提交导致了问题


页: [1]
查看完整版本: github回退定位问题