577 words
3 minutes
How to amend date of git commit
2025-10-01
统计加载中...

Instructions#

  1. (Optional) Check the commit hash

    Terminal window
    git log --oneline
  2. Start rebase from the designated commit’s parent

    Terminal window
    git rebase -i <hash/of/parentcommit>

    or recent commits

    Terminal window
    git rebase -i HEAD~<num/of/commits>
  3. Press Ins to enter insert mode -> Change ‘pick’ to ‘edit’ -> Press Esc to quit insert mode -> Type '' to save and exit

  4. Amend date of the current commit if needed

    Terminal window
    GIT_COMMITTER_DATE="<YYYY>-<MM>-<DD>T<HH>:<MM>:<SS>" git commit --amend --date="<YYYY>-<MM>-<DD>T<HH>:<MM>:<SS>"
  5. Finish rebase or go to the next commit

    Terminal window
    git rebase --continue
  6. Repeat step 4&5 if rebase is still in progress

Example#

Terminal window
Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod)
$ git log --oneline
2d3822c (HEAD -> prod) Chores - Rename backend&frontend to server&client - Adjust modules importation
def90ec Migrate 'server/tools/analyser' directory to separate repository as submodule
89797a6 Update README
e89dc77 Algrithm improvement - Move save_image function form calc.py to extract.py and rename it to io.py - Speed up prediction by adjust the order to first move tensor to device and then transform - Develop the memory leak solver - Correct annotations and capitalizations - Add demo.py for analyser module testing
f401673 Algrithm improvement - Refactor code structure for better readability - Add yolo model for floatWin detection - Use memory_profiler to monitor memory usage - Fix memory leak
3fff825 Algrithm improvement - Optimize traversal part - Implement timestamp-based detection method - Add YOLO model to handle floating window type
9092649 Algrithm Optimization - Remove toTensor() from transformation pipeline - Replace PIL with cv2.imread() or torchvision.io.read_image() for faster tensor conversion
6c0bffc Algrithm improvement - Add video frameRate as return value - Support image prediction - Fix size mismatch issue - Add more rules for flickerType checking
Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod)
$ git rebase -i HEAD~2
Stopped at 1b789a4... Migrate 'server/tools/analyser' directory to separate repository as submodule
You can amend the commit now, with
git commit --amend
Once you are satisfied with your changes, run
git rebase --continue
Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod|REBASE 1/2)
$ GIT_COMMITTER_DATE="2025-01-14T18:19:20" git commit --amend --date="2025-01-14T18:19:20"
[detached HEAD def90ec] Migrate 'server/tools/analyser' directory to separate repository as submodule
Date: Tue Jan 14 18:19:20 2025 +0800
12 files changed, 4 insertions(+), 890 deletions(-)
create mode 100644 .gitmodules
create mode 160000 backend/tools/analyser
delete mode 100644 backend/tools/analyser/__init__.py
delete mode 100644 backend/tools/analyser/algrithm/__init__.py
delete mode 100644 backend/tools/analyser/algrithm/predict1.py
delete mode 100644 backend/tools/analyser/algrithm/predict2.py
delete mode 100644 backend/tools/analyser/algrithm/utils/__init__.py
delete mode 100644 backend/tools/analyser/algrithm/utils/calc.py
delete mode 100644 backend/tools/analyser/algrithm/utils/inference.py
delete mode 100644 backend/tools/analyser/algrithm/utils/io.py
delete mode 100644 backend/tools/analyser/algrithm/utils/load.py
delete mode 100644 backend/tools/analyser/analyse.py
Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod|REBASE 1/2)
$ git rebase --continue
Stopped at 352aa96... Chores - Rename backend&frontend to server&client - Adjust modules importation
You can amend the commit now, with
git commit --amend
Once you are satisfied with your changes, run
git rebase --continue
Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod|REBASE 2/2)
$ GIT_COMMITTER_DATE="2025-01-14T19:20:21" git commit --amend --date="2025-01-14T19:20:21"
[detached HEAD 2d3822c] Chores - Rename backend&frontend to server&client - Adjust modules importation
Date: Tue Jan 14 19:20:21 2025 +0800
22 files changed, 46 insertions(+), 59 deletions(-)
rename {frontend => client}/assets/__init__.py (100%)
rename {frontend => client}/assets/images/icons/file-earmark-arrow-up.svg (100%)
rename {frontend => client}/assets/sources.py (100%)
rename {frontend => client}/components/__init__.py (100%)
rename {frontend => client}/components/components.py (100%)
rename {frontend => client}/functions.py (90%)
rename {frontend => client}/main.py (89%)
rename {frontend => client}/windows/__init__.py (100%)
rename frontend/windows/ui/UI_Window.py => client/windows/ui/ui_window.py (99%)
rename {frontend => client}/windows/windows.py (98%)
delete mode 100644 frontend/config.py
rename {backend => server}/main.py (100%)
rename {backend => server}/tools/__init__.py (100%)
rename {backend => server}/tools/analyser (100%)
rename {backend => server}/tools/demo.py (100%)
rename {backend => server}/tools/exec.py (100%)
rename {backend => server}/tools/recorder/__init__.py (100%)
rename {backend => server}/tools/recorder/record.py (100%)
rename {backend => server}/tools/recorder/utils/__init__.py (100%)
rename {backend => server}/tools/recorder/utils/adb.py (100%)
Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod|REBASE 2/2)
$ git rebase --continue
Successfully rebased and updated refs/heads/prod.
How to amend date of git commit
https://blog.spr-aachen.com/posts/tutorial-git/amendcommitdate/
Author
Spr-Aachen
Published at
2025-10-01
License
CC BY-NC-SA 4.0

Some information may be outdated

封面
Music
Artist
封面
Music
Artist
0:00 / 0:00