Web TippsUse custom web fonts in Google Sheets charts(08.09.2026 um 17:05 Uhr)
Web TippsIntroducing the new 1Password App for Google Chat(08.09.2026 um 18:02 Uhr)
Web TippsUse custom web fonts in Google Sheets charts(08.09.2026 um 17:05 Uhr)
Web TippsIntroducing the new 1Password App for Google Chat(08.09.2026 um 18:02 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 3 Min Lesezeit
0

Clean Up Your GitHub using git-filter-repo: Email Updates and Commit Messages

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Do you know that GitHub only tracks commits from verified email addresses? I discovered that after noticing gaps in my own contribution history. My mistake? Using different email addresses for my commits, including dummy emails for spam prevention.



In this article, I'll show you how to safely rewrite your git history to update email addresses and standardize commit messages. Your original timestamps and actual changes will remain exactly as they were.



Table of Contents:




  • Understanding GitHub Email Verification

  • Fixing Historical Commits

  • Standardizing Commit Messages

  • Tips






Understanding GitHub Email Verification



GitHub provides you with official no-reply addresses. These addresses serve two purposes:




  • They keep your real email private

  • They ensure all your commits are properly tracked



You can set this up by following .






Step 2: Clone Your Repository






CODE
git clone [email protected]:yourusername/yourrepo.git
cd yourrepo









Step 3: Rewrite History






CODE
git filter-repo --force --email-callback '
old_email = b"[email protected]"
new_email = b"[email protected]"

if email == old_email:
return new_email
return email
'








  • The --email-callback option modifies only the email addresses in commits.






Step 4: Fix Remote Settings After git filter-repo



Since git filter-repo removes remote settings, re-add the remote repository.




CODE
git remote add origin [email protected]:yourusername/yourrepo.git









Step 5: Review and Push Changes






CODE
git log --pretty=full  # Verify the changes
git push --force origin main
git push --force --tags









Standardizing Commit Messages



Need to clean up your commit messages? git-filter-repo can help you convert to conventional commits, fix typos, or add ticket numbers. Here are some examples.






Basic Message Updates






CODE
git filter-repo --force --message-callback '
if b"Added" in message:
return message.replace(b"Added", b"feat: add")
return message
'










Adding Ticket Numbers






CODE
git filter-repo --force --message-callback '
if not b"JIRA-" in message:
return b"JIRA-123: " + message
return message
'










Multiple Pattern Replacements






CODE
git filter-repo --force --message-callback '
replacements = {
b"Added": b"feat: add",
b"Fixed": b"fix:",
b"Updated": b"chore: update"
}
for old, new in replacements.items():
if message.startswith(old):
return message.replace(old, new)
return message
'










Tips



Before making any changes:




  • Create a backup of your repository first

  • Consider using --dry-run first to preview changes

  • Verify your changes with git log --pretty=full before pushing



Hope this helps you clean up your GitHub history. Your future self will thank you!

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
Use custom web fonts in Google Sheets charts
2 Quellen
Introducing the new 1Password App for Google Chat
1 Quelle
Context-aware access controls are available for Gemini Enterprise in the Admin console
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Clean Up Your GitHub using git-filter-repo: Email Updates and Commit Messages

Thematisch verwandte Begriffe: Clean, Your, GitHub, using · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...