Tools

Github - Merge Accounts


由於個人學習原因,創了不同Github帳號來寫程式,

切換帳號覺得很麻煩,於是想合併這些Github帳號 >o<

  1. 將欲保留的repositories進行轉移

即將移除帳號中設定進行轉移動作



保留帳號信箱確認轉移信件

保留帳號中確認轉移成功

  1. 更新remote URLs

查詢remote的位置

$ git remote -v
origin  git@github.com:USERNAME/REPOSITORY.git (fetch)
origin  git@github.com:USERNAME/REPOSITORY.git (push)

更新remote的位置

$ git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
  1. 刪除Github帳號


  1. 把過去commits歸於保留帳號所有

進入保留帳號,加入慣用的email,用於未來commits使用

Reference

Merging multiple user accounts
Merge Multiple GitHub Accounts + Transfer Commit History