For the past few days I used a different laptop, I set up git and logged in, but I accidently used my username with a wrong email.
Today I noticed that my commits from the past few days did not show up on my github profile dashboard so checked what's going on and noticed that I used the wrong email to log in.
I tried a few different ways to fix it, but none of those worked.
1.
git rebase -i -p <The last commit with the good email>
Then for each commit.
git commit --amend --author="good name <good email>" --no-edit
git rebase --continue
Instead of just changing the author of the commits, it made new commits with my good email but didn't change the old ones.
2.
git filter-branch --env-filter 'if [ "$GIT_AUTHOR_EMAIL" = "incorrect@email" ]; then
GIT_AUTHOR_EMAIL=correct@email;
GIT_AUTHOR_NAME="Correct Name";
GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL;
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; fi' -- --all
as seen here, but it didn't do anything...
3. In one of the answers somebody mentioned that I should use the same command as I used.
git rebase -i -p <The last commit with the good email>
but without the "-p". I tried it, but it also made new commits and didn't keep the old commit's with the old dates.
So, I need help getting all the new commits of my history and fixing the old ones to have the good email.