您的位置:首页 > 编程语言

Github 初次使用 commit命令提交失败

2015-08-15 13:59 876 查看
Git是一个分布式的版本控制系统,最初由Linus Torvalds编写,用作Linux内核代码的管理。在推出后,Git在其它项目中也取得了很大成功,尤其是在Ruby社区中。目前,包括Rubinius、Merb和Bitcoin在内的很多知名项目都使用了Git。Git同样可以被诸如Capistrano和Vlad the Deployer这样的部署工具所使用。
新手在第一次练习使用时,在使用git commit命令时会执行失败,比如我在首次使用时先使用git init命令初始化本地仓库,然后要用git commit -m "Initial commit"命令提交,但是提示失败:
*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'Aoliaovier@HaoyongWin10PC.(none


)’)



命令执行失败的原因是没有在本地设置用户名和邮箱,在命令行设置一下即可: git config –global user.email “you@example.com”

git config –global user.name “Your Nam”, 然然后重新用git commit -m “Initial commit”命令提交。



最后输入git push -u origin master ,将你本地的仓库提交到你的github账号里此时会要求你输入你的github的账号和密码。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: