Can‘t connet to repository from configured remote.

Can‘t connet to repository from configured remote.You could want to check .git config.Do you want to proceed anyway?

Can‘t connet to repository from configured remote.
这是我之前在用Android Studio同步到GitHub上时,遇到的同步异常的问题,需要检查配置文件。我点了yes,接下来就报了各种错误,大致意思是用户名和邮箱和github上的用户名邮箱不对应。

但是在github我的账户中,这个工程还是创建成功,却是个空壳。删除了github上的工程,再来看看上面as的这个提示,它希望我去检查一下.gitconfig这个配置文件。

因为之前报错提示说用户名和邮箱不正确的错误。那么可能需要手动配置github上的用户名和邮箱了

.gitconfig这个文件在 C:\Users\用户名.gitconfig(win7/win8系统),打开会看到user标签

[user]
name = 用户名
email = 邮箱

修改成github上的用户名和邮箱就可以了。

也可以使用命令行来设置:

Git config –global user.name 用户名

git config –global user.email 邮箱

配置完成了,再来看我的本地工程,文件变成绿色的了,因为之前提交过一次,所以我需要撤销掉之前的操作,恢复到之前未提交的状态

撤销操作http://blog.****.net/yishion_l/article/details/72972443