577 words
3 minutes
How to amend date of git commit
Instructions
-
(Optional) Check the commit hash
Terminal window git log --oneline -
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> -
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 GIT_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 git rebase --continue -
Repeat step 4&5 if rebase is still in progress
Example
Spr_Aachen@DESKTOP-UEUQRBG MINGW64 /d/Projekt/Python Projects/Android-Screen-Defects-Detector (prod)$ git log --oneline2d3822c (HEAD -> prod) Chores - Rename backend&frontend to server&client - Adjust modules importationdef90ec Migrate 'server/tools/analyser' directory to separate repository as submodule89797a6 Update READMEe89dc77 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 testingf401673 Algrithm improvement - Refactor code structure for better readability - Add yolo model for floatWin detection - Use memory_profiler to monitor memory usage - Fix memory leak3fff825 Algrithm improvement - Optimize traversal part - Implement timestamp-based detection method - Add YOLO model to handle floating window type9092649 Algrithm Optimization - Remove toTensor() from transformation pipeline - Replace PIL with cv2.imread() or torchvision.io.read_image() for faster tensor conversion6c0bffc 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~2Stopped at 1b789a4... Migrate 'server/tools/analyser' directory to separate repository as submoduleYou 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 submoduleDate: Tue Jan 14 18:19:20 2025 +080012 files changed, 4 insertions(+), 890 deletions(-)create mode 100644 .gitmodulescreate mode 160000 backend/tools/analyserdelete mode 100644 backend/tools/analyser/__init__.pydelete mode 100644 backend/tools/analyser/algrithm/__init__.pydelete mode 100644 backend/tools/analyser/algrithm/predict1.pydelete mode 100644 backend/tools/analyser/algrithm/predict2.pydelete mode 100644 backend/tools/analyser/algrithm/utils/__init__.pydelete mode 100644 backend/tools/analyser/algrithm/utils/calc.pydelete mode 100644 backend/tools/analyser/algrithm/utils/inference.pydelete mode 100644 backend/tools/analyser/algrithm/utils/io.pydelete mode 100644 backend/tools/analyser/algrithm/utils/load.pydelete 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 --continueStopped at 352aa96... Chores - Rename backend&frontend to server&client - Adjust modules importationYou 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 importationDate: Tue Jan 14 19:20:21 2025 +080022 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.pyrename {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 --continueSuccessfully rebased and updated refs/heads/prod. How to amend date of git commit
https://blog.spr-aachen.com/posts/tutorial-git/amendcommitdate/ Some information may be outdated