同步Android代码时遇到错误:fatal: empty ident <wyp@ubuntu.(none)> not allowed
是你没有正确设置电子邮箱和用户名
wyp@ubuntu:~/android_source$ repo init -u https://android.googlesource.com/platform/manifest
Traceback (most recent call last):
File "/home/wyp/android_source/.repo/repo/main.py", line 385, in <module>
_Main(sys.argv[1:])
File "/home/wyp/android_source/.repo/repo/main.py", line 365, in _Main
result = repo._Run(argv) or 0
File "/home/wyp/android_source/.repo/repo/main.py", line 137, in _Run
result = cmd.Execute(copts, cargs)
File "/home/wyp/android_source/.repo/repo/subcmds/init.py", line 289, in Execute
self._ConfigureUser()
File "/home/wyp/android_source/.repo/repo/subcmds/init.py", line 211, in _ConfigureUser
name = self._Prompt('Your Name', mp.UserName)
File "/home/wyp/android_source/.repo/repo/project.py", line 590, in UserName
self._LoadUserIdentity()
File "/home/wyp/android_source/.repo/repo/project.py", line 603, in _LoadUserIdentity
u = self.bare_git.var('GIT_COMMITTER_IDENT')
File "/home/wyp/android_source/.repo/repo/project.py", line 1963, in runner
p.stderr))
error.GitError: manifests var:
*** Please tell me who you are.
//看上边这句话,貌似说“告诉你是谁?”
//Run就是解决方法咯(这是系统提示的)
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: empty ident <wyp@ubuntu.(none)> not allowed
//具体做法如下
wyp@ubuntu:~/android_source$ git config --global user.email "renjiameng@yeah.net"
wyp@ubuntu:~/android_source$ git config --global user.name "rjm"
wyp@ubuntu:~/android_source$ repo init -u https://android.googlesource.com/platform/manifest
Your identity is: rjm <renjiameng@yeah.net>
If you want to change this, please re-run 'repo init' with --config-name
Testing colorized output (for 'repo diff', 'repo status'):
black red green yellow blue magenta cyan white
bold dim ul reverse
Enable color display in this user account (y/N)? y
repo initialized in /home/wyp/android_source
//OK,用户设置完成,可以SYNC咯。
来源:oschina
链接:https://my.oschina.net/u/246816/blog/50722