Reputation: 6005
I use Git for Windows and the GUI that comes along with it, and when I create a new commit either in Git Bash or Git GUI, it's creating new commits with the same date as the one before it.
I have no idea why it's doing this. I've gotten most of the commits I needed done tonight, but I don't want all my commits to be stuck on November 13th!
A week later (11/20) and I am still able to reproduce this issue. These are my global Git variables:
MINGW64 /d/Users/Public/Music/Playlists (master)
$ echo ${!GIT_*}
GIT_EXEC_PATH
MINGW64 /d/Users/Public/Music/Playlists (master)
$ echo $GIT_EXEC_PATH
C:\Program Files\Git\mingw64/libexec/git-core
Upvotes: 3
Views: 317
Reputation: 6005
Short answer: Don't amend commits I guess.
I know that I've amended commits without it affecting the next commit on other systems, i.e. Linux and OS X, but just to fix my current repository so I could keep using it, this is what I did:
Playlists2$ git checkout e71521b3b26c5e053fa7ce2f4e2ca602de9b734f
C:\WINDOWS\system32>ROBOCOPY Playlists2 Playlists1 /MIR /COPY:D /XD .git
Playlists1$ GIT_AUTHOR_DATE="2016-11-13 19:47:27" GIT_COMMITTER_DATE="2016-11-13 19:47:27" git commit -m "Massive UUID updates for entire directory, but restore last modified date\n\nROBOCOPY <backup> <cwd> /COPY:T /XD .git"
Playlists2$ git checkout 9ec2d7abfac0c1a1c5eaeb58abedcb65bbab29e5
C:\WINDOWS\system32>ROBOCOPY Playlists2 Playlists1 /MIR /COPY:D /XD .git
Playlists1$ GIT_AUTHOR_DATE="2016-11-13 21:26:46" GIT_COMMITTER_DATE="2016-11-13 21:26:46" git commit -m "Fix missing tracks and save dates before mass deleting playlists"
Playlists2$ git checkout fdea81464c9fff080249b5287693a4d0555fcc06
C:\WINDOWS\system32>ROBOCOPY Playlists2 Playlists1 /MIR /COPY:D /XD .git
Playlists1$ GIT_AUTHOR_DATE="2016-11-13 22:11:51" GIT_COMMITTER_DATE="2016-11-13 22:11:51" git commit -m "Remove unused playlists and collapse soundtracks into mega playlist"
Playlists2$ git checkout 0fe301fc61526944ae178d360b0482739e0dfefc
C:\WINDOWS\system32>ROBOCOPY Playlists2 Playlists1 /MIR /COPY:D /XD .git
Playlists1$ GIT_AUTHOR_DATE="2016-11-13 22:18:34" GIT_COMMITTER_DATE="2016-11-13 22:18:34" git commit -m "Remove interwoven, contemporary, duplicate, and missed playlists"
Playlists2$ git checkout
C:\WINDOWS\system32>ROBOCOPY Playlists2 Playlists1 /MIR /COPY:D /XD .git
Playlists1$ GIT_AUTHOR_DATE="2016-11-13 22:22:00" GIT_COMMITTER_DATE="2016-11-13 22:22:00" git commit -m "Add new playlist for Aurora"
I restored an old version of my Playlists directory, renaming it Playlists1 (had to delete the desktop.ini that made the directory display as Playlists) with the current corrupted version Playlists2, checked out each commit from Playlists2, mirrored the data to Playlists1 excluding the .git folder, and made the commit with date overrides.
I'll play around with the test repository I created since there's a way to fix the Git repository so that it starts committing with the correct author date again (since the first 2 were duplicates and next three were duplicates), and I'll leave this question unaccepted until then.
Upvotes: 1
Reputation: 60245
Git takes rarely-used overrides from the environment, and the only thing I can think of that would produce the behavior you're describing here is if you've somehow left GIT_COMMITTER_DATE
set and exported. Perhaps you sourced a script into your running shell?
Anyway, you can see the names of any current git overrides with echo ${!GIT_*}.
unset` them if you find any, that should do it.
Upvotes: 3