> git fsck
error in commit %hash%: invalid author/committer line - bad time zone
> git show %hash%
Date: Mon Mar 18 23:57:14 2201 -5274361
How this can be fixed? With git rebase
in master branch and delete\update commit info, or do some magic in project .git
directory, or somehow else?
For all commits where you want to change the date, replace pick by edit (or just e ), then save and quit your editor. The first date is the commit date, the second one is the author date. Repeat the process until you amend all your commits. Check your progression with git status .
Each committer's timezone is surely saved in github's server.
The git commit --amend command is a convenient way to modify the most recent commit. It lets you combine staged changes with the previous commit instead of creating an entirely new commit. It can also be used to simply edit the previous commit message without changing its snapshot.
Check the documentation for git describe . It finds the nearest tag to a given commit (that is a tag which points to an ancestor of the commit) and describes that commit in terms of the tag. In newer versions, git describe --tags --abbrev=0 REV will be useful when you don't want the junk on the tag.
I'd go for the git rebase -i
solution.
Edit the wrong commits and git commit --amend --date="Mon Jul 24 14:00 2015 +0100"
when you stop on them.
If you rebase on pushed commits, you'll have to rewrite the branch history (in your case master
) by doing a push -f
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With