批量修改git提交的用户名和Email


# 批量修改git提交的用户名和Email

有时候git配置错了用户名和邮箱,想修改过来,可以用如下这个脚本:

fix-git-username-email.sh (opens new window)

使用方法:

Usage fix-git-username-email.sh arguments ...
 
Arguments:
  --help
        Display the help screen
 
  --unexpected-username
        Unexpected username which you want to fix
 
  --unexpected-email
        Unexpected email which you want to fix
 
  --expected-username
        Username what you expected
 
  --expected-email
        Email what you expected
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

这个脚本可以支持对用户名和email的修改:--unexpected-username--unexpected-email 两者必须至少指定一个;--expected-username--expected-email 也必须至少指定一个。