【eclipse】配置author和commiter,git配置user.name和user.email

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sayyy/article/details/84314309

概述

  • eclipse 4.9.0
  • 使用git提交文件/代码时,会附带上当前操作者信息。
  • 在git中查看历史时,会通过操作者信息来确定谁修改了哪些文件/代码。
  • 在eclipse中,每次提交代码时,需要填写author和commiter。
  • 在eclipse中,author和commiter每次默认的格式为:user.email<user.email>
  • user.email和user.email在git config中定义。
  • git config有全局配置和当前仓库配置之分。
  • 当“当前仓库中的git config未定义user.email和user.email”时,则取全局git config中的user.email和user.email。
  • 当“当前仓库中的git config已定义user.email和user.email”时,则取当前仓库git config中的user.email和user.email。

eclipse中配置全局git config配置

在这里插入图片描述

eclipse中配置当前仓库git config配置

在这里插入图片描述

测试

  • 创建两个项目:test、test_global
  • 创建两个项目:gitstore_test、gitstore_global
  • test项目放到gitstore_test仓库中
  • test_global项目放到gitstore_global仓库中
  • gitstore_test仓库设定git config,参见上面“eclipse中配置当前仓库git config配置”中截图
  • gitstore_global仓库未设定git config,使用全局git config配置,参见上面“eclipse中配置全局git config配置”中截图

test项目提交时author和commiter

在这里插入图片描述

test_global项目提交时author和commiter

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/sayyy/article/details/84314309