Did you change your email address? Got a new name? You can change those outdated git configurations across all of your repos at once, and make the remote repositories (e.g. GitHub) reflect those changes!
This is an upgrade over the previous PHP-based solution in that a. it doesn't mess up your commit history (uses git stash
instead), b. it pushes across all branches (unlike before, which only pushed master
), and c. the logging is less cluttered and easier to pinpoint what went wrong where (especially during force pushes).
Clone this repository.
- Run
yarn start
- Specify a directory. Anything from
~/Projects
,/Users/home/$project
, to./blah
flies! - Provide the outdated git information you'd like to update (i.e. your previous git config)
- Check that the new git information looks right
- (Optional) enable force push
- ???
- Profit!
Only enable force push with repos that you own or repos where you know the others will be okay with this change!
If your git
is set to use a non-English language (e.g. Korean),
git(fullPath).checkIsRepo()
can go apeshit for some reason. In that case, try
echo 'export LANG="en_US" # for git' >> ~/.bash_profile
Additionally, the git configurations are case-sensitive, meaning that [email protected]
and [email protected]
look the same to git
.
You can do a simple integration test (unfortunately interactive in some parts, but a lot of it is still automated) as follows:
yarn setup
- Provide your GitHub credentials, and modify
scripts/setup.sh
with your GitHub username
- Provide your GitHub credentials, and modify
yarn start
:- Use the following credentials:
- dir:
./sample
- old name: your current git name
- old email: your current git email
- new name: something different from your current git name
- new email: something different from your current git email
- dir:
- Afterwards, you should see the changes reflected on the github repo
- Use the following credentials:
yarn teardown
- Provide your GitHub credentials, and modify
scripts/teardown.sh
with your GitHub username
- Provide your GitHub credentials, and modify