1.查看用户名、邮箱和密码
git config user.name // 查看用户名
git config user.email // 查看邮箱
git config user.password // 查看密码
2.修改用户名、邮箱和密码
git config --global --replace-all user.name "要修改的用户名"
git config --global --replace-all user.email"要修改的邮箱"
git config --global --replace-all user.password "要修改的密码"
3.代码冲突
git pull —>git push
git pull(等价于:git fetch 再git merge)
如果出错:
error Your local changes to the following files would be overwritten by merge
原因是:
别人和你改动了同一个文件了,git的merge无法处理,所以提示你可能会被覆盖
解决方案:
先去暂存自己的改动:
git stash
再去获取最新改动:
git pull
然后恢复自己本地的改动:
git stash pop
注:
如果pop后有冲突,冲突文件内部会有:
<<<<<<<head到======= 是在当前分支合并之前的文件内容(自己)
=======到>>>>>>>是您下拉的内容(其他分支的代码内容)
之类的标示,找到并一点点解决掉,即可。