解决 Github用户名 变为 invalid-email-address 问题

解决 Github用户名 变为 invalid-email-address 问题

If the identity used for this commit is wrong, you can fix it with:

git commit --amend --author='Your Name <you@example.com>'

一、首页解决操作

补上 Github 邮箱信息:vim $HOME/.gitconfig

git config --global user.name "username"
git config --global user.email "username@email.com"
git push origin master

这时候我们就可以发现,首页已经恢复正常了。

注意:不要使用 "git init" 初始化命令!

二、内容页解决

查看 Github 日志:bash -c "git log"

git rebase --interactive 4d49c2e
--interactive/-i 4d49c2e/4d49c2e995be282f8335(略)cde4194e

git commit --amend --reset-author

git rebase --continue
git rebase --continue
git rebase --continue

git push -f  强制覆盖推到远端

注意:平常操作并不会用到上述所有命令,用不好大家的 commit 会丢失或者被篡改的

感兴趣,可以新建个 repo 研究下~

小猫咪问你,解决了嘛~

一些其他

Git版本控制

创建仓库
git init
git clone
git config

保存修改

git add
git commit

查看仓库

git status
git log –oneline

撤销修改

查看之前的commit

git checkout
git checkout
git checkout

撤销公共修改

git revert

撤销本地修改

git reset
git clean

重写Git历史记录

git commit –amend
git rebase
git reflog

Git协作开发

分支

git branch
git checkout
git merge

仓库同步

git remote
git fetch
git pull
git push

posted @ 2017-01-25 11:33  季文康  阅读(2893)  评论(0编辑  收藏  举报