Table of Contents
577 words
3 minutes
How to amend date of git commit
Instructions
-
(Optional) Check the commit hash
Terminal window 1git log --oneline -
Start rebase from the designated commit’s parent
Terminal window 1git rebase -i <hash/of/parentcommit>or recent commits
Terminal window 1git rebase -i HEAD~<num/of/commits> -
Press
Insto enter insert mode -> Change ‘pick’ to ‘edit’ -> PressEscto quit insert mode -> Type '' to save and exit -
Amend date of the current commit if needed
Terminal window 1GIT_COMMITTER_DATE="<YYYY>-<MM>-<DD>T<HH>:<MM>:<SS>" git commit --amend --date="<YYYY>-<MM>-<DD>T<HH>:<MM>:<SS>" -
Finish rebase or go to the next commit
Terminal window 1git rebase --continue -
Repeat step 4&5 if rebase is still in progress
Example
1Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod)2$ git log --oneline32d3822c (HEAD -> prod) Chores - Rename backend&frontend to server&client - Adjust modules importation4def90ec Migrate 'server/tools/analyser' directory to separate repository as submodule589797a6 Update README6e89dc77 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 testing7f401673 Algrithm improvement - Refactor code structure for better readability - Add yolo model for floatWin detection - Use memory_profiler to monitor memory usage - Fix memory leak83fff825 Algrithm improvement - Optimize traversal part - Implement timestamp-based detection method - Add YOLO model to handle floating window type99092649 Algrithm Optimization - Remove toTensor() from transformation pipeline - Replace PIL with cv2.imread() or torchvision.io.read_image() for faster tensor conversion106c0bffc Algrithm improvement - Add video frameRate as return value - Support cover prediction - Fix size mismatch issue - Add more rules for flickerType checking11
12Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod)13$ git rebase -i HEAD~214Stopped at 1b789a4... Migrate 'server/tools/analyser' directory to separate repository as submodule15You can amend the commit now, with16
17git commit --amend18
19Once you are satisfied with your changes, run20
21git rebase --continue22
23Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod|REBASE 1/2)24$ GIT_COMMITTER_DATE="2025-01-14T18:19:20" git commit --amend --date="2025-01-14T18:19:20"25[detached HEAD def90ec] Migrate 'server/tools/analyser' directory to separate repository as submodule26Date: Tue Jan 14 18:19:20 2025 +08002712 files changed, 4 insertions(+), 890 deletions(-)28create mode 100644 .gitmodules29create mode 160000 backend/tools/analyser30delete mode 100644 backend/tools/analyser/__init__.py31delete mode 100644 backend/tools/analyser/algrithm/__init__.py32delete mode 100644 backend/tools/analyser/algrithm/predict1.py33delete mode 100644 backend/tools/analyser/algrithm/predict2.py34delete mode 100644 backend/tools/analyser/algrithm/utils/__init__.py35delete mode 100644 backend/tools/analyser/algrithm/utils/calc.py36delete mode 100644 backend/tools/analyser/algrithm/utils/inference.py37delete mode 100644 backend/tools/analyser/algrithm/utils/io.py38delete mode 100644 backend/tools/analyser/algrithm/utils/load.py39delete mode 100644 backend/tools/analyser/analyse.py40
41Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod|REBASE 1/2)42$ git rebase --continue43Stopped at 352aa96... Chores - Rename backend&frontend to server&client - Adjust modules importation44You can amend the commit now, with45
46git commit --amend47
48Once you are satisfied with your changes, run49
50git rebase --continue51
52Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod|REBASE 2/2)53$ GIT_COMMITTER_DATE="2025-01-14T19:20:21" git commit --amend --date="2025-01-14T19:20:21"54[detached HEAD 2d3822c] Chores - Rename backend&frontend to server&client - Adjust modules importation55Date: Tue Jan 14 19:20:21 2025 +08005622 files changed, 46 insertions(+), 59 deletions(-)57rename {frontend => client}/assets/__init__.py (100%)58rename {frontend => client}/assets/images/icons/file-earmark-arrow-up.svg (100%)59rename {frontend => client}/assets/sources.py (100%)60rename {frontend => client}/components/__init__.py (100%)61rename {frontend => client}/components/components.py (100%)62rename {frontend => client}/functions.py (90%)63rename {frontend => client}/main.py (89%)64rename {frontend => client}/windows/__init__.py (100%)65rename frontend/windows/ui/UI_Window.py => client/windows/ui/ui_window.py (99%)66rename {frontend => client}/windows/windows.py (98%)67delete mode 100644 frontend/config.py68rename {backend => server}/main.py (100%)69rename {backend => server}/tools/__init__.py (100%)70rename {backend => server}/tools/analyser (100%)71rename {backend => server}/tools/demo.py (100%)72rename {backend => server}/tools/exec.py (100%)73rename {backend => server}/tools/recorder/__init__.py (100%)74rename {backend => server}/tools/recorder/record.py (100%)75rename {backend => server}/tools/recorder/utils/__init__.py (100%)76rename {backend => server}/tools/recorder/utils/adb.py (100%)77
78Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod|REBASE 2/2)79$ git rebase --continue80Successfully rebased and updated refs/heads/prod. How to amend date of git commit
/posts/tutorial-git/amendcommitdate/ Some information may be outdated