Background
I just noticed that the entire commit history in my repo is doubled up.
For reference, I am the sole contributor, and it's a private repository.
It will appear as if there are two contributors, because I have an old account, whose info was still in git config --global user.email
on one of my computers.
The doubling-up occurred after I cloned the project and started working on it from another computer.
Excerpt from git log
:
commit 76cd0efa307e501abfe13cd907957e4dcff7e75e
Author: myaccount <account1@gmail.com>
Date: Mon Mar 21 18:58:39 2016 +0100
FEATURE - Add VideoNotFoundException.
commit 0430ef9dc5d3baa2189ba1c18b4bedb9d2940e51
Author: myaccount <account2@gmail.com>
Date: Mon Mar 21 18:58:39 2016 +0100
FEATURE - Add VideoNotFoundException.
commit 94e7221e472e29119c9e4fe48944cd4d7528e207
Author: myaccount <account1@gmail.com>
Date: Mon Mar 21 18:41:11 2016 +0100
FEATURE - Add previous/next video links to video view.
commit 8b26a51b84d4fb3ae72eefe2834649ff8bc8b7ce
Author: myaccount <account2@gmail.com>
Date: Mon Mar 21 18:41:11 2016 +0100
FEATURE - Add previous/next video links to video view.
commit 7f9b3b6f214e445918d509d7f9377d3d7ce875da
Author: myaccount <account1@gmail.com>
Date: Tue Mar 15 17:05:46 2016 +0100
CLEANUP - Remove unused code/uses.
commit c83fa2c238d1437c967b40d6e807c2567eb7572d
Author: myaccount <account2@gmail.com>
Date: Tue Mar 15 17:05:46 2016 +0100
CLEANUP - Remove unused code/uses.
There are now 234 commits in the repository, of which about half are actual, real commits.
This is also reflected on GitHub:
git log --graph --decorate --oneline --all however does NOT reflect this.
* 303bbfe (HEAD, origin/master, origin/HEAD, master) MERGE
|\
| * b8052ce REFACTOR - Refactor front page content for maintainability.
| * b5907b2 VISUAL - Improve front page mobile view.
| * 0430ef9 FEATURE - Add VideoNotFoundException.
| * 8b26a51 FEATURE - Add previous/next video links to video view.
| * c83fa2c CLEANUP - Remove unused code/uses.
| * 9e82b8f BUGFIX - Fix redirecting /login to front page.
| * 491b88e BUGFIX - Redirecting old playlist and video links to new ones. WIP: Code duplication!
| * a7da158 Merge branch 'master' of https://github.com/alrasch/UDLv2
| |\
| | * a3bfe1b BUGFIX - Fix 500 error on 404 page.
| * | 258d2e9 BUGFIX - Redirecting old URLs to new ones.
| |/
| * 4426681 FEATURE - Add more UDL logo assets.
| * 7d15c7c FEATURE - Add custom 404 page.
| * 6fbb5dd FEATURE - Add 'forgot password' function.
| * 92dd4c8 VISUAL - Fix video view layout.
| * 8a7decb VISUAL - Scale UDL logo to 75% on front page.
| * 0900fbc VISUAL - Rearrange discipline view layout.
| * 1ba38c8 VISUAL - Scale UDL logo on playlist view down to 75%.
| * eef7cd1 VISUAL - Fix playlist view layout.
| * b7fa6cb Made sidebar space on front page.
| * ace9fb6 COSMETIC - Logo on front page and navbar. Rounder buttons.
| * bbf12b3 Add MathJax LaTeX sitewide.
| * 6629128 Customize register form and add email activation.
| * 27f7114 FEATURE - Add basic search to navbar.
My attempts
I'm not opposed to rebasing and squashing if that's what I have to do. I've tried using git rebase -i HEAD~n
but the doubling-up is not reflected in the list of commits there, so I can't.
Question
Can I reset the repository to an earlier state (based on a point in time)? (For reference, my repo is on GitHub.)
If nothing works, I suppose I could start the repository anew, as all functionality is preserved. It's just a messy history.
Related question
Please do not close as duplicate of Fixing git double-commit history. While the questions are similar, the accepted answer doesn't apply to my case, as the doubled commits are not reflected in the git rebase
file where you choose pick/squash.