ionic start 运行git出错

在使用 Ionic 命令创建新项目时,遇到 Git 提交失败的问题,错误提示为 'Please tell me who you are.' 和 'unable to auto-detect email address'。解决方法是设置 Git 的全局用户邮箱和用户名,通过运行 `git config --global user.email "you@example.com"` 和 `git config --global user.name "Your Name"` 命令来配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.错误显示:


admin@bogon ~/IonicProjs 

$ ionic start myApp tabs

Creating directory ./myApp - done!

[INFO] Fetching app base

       (https://github.com/ionic-team/ionic2-app-base/archive/master.tar.gz)

Downloading - done!

[INFO] Fetching starter template tabs

       (https://github.com/ionic-team/ionic2-starter-tabs/archive/master.tar.gz)

Downloading - done!

Updating package.json with app details - done!

Creating configuration file ionic.config.json - done!

[INFO] Installing dependencies may take several minutes!

> npm install

Running command - done!

> npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest

Running command - done!

> git init

Running command - done!

> git add -A

Running command - done!

> git commit -m "Initial commit" --no-gpg-sign

Running command - failed!

[ERROR] An error occurred while running git commit -m "Initial commit"

        --no-gpg-sign (exit code 128):

        

        

        *** 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

        'admin@bogon.(none)')


2.解决方法:

错误原因:安装好Git后没配置email,name.
配置:
admin@bogon ~
$ git config --global user.email “123456789@163.com "
admin@bogon ~
$ git config --global user.name “yourName”

查看:
admin@bogon ~
$ git config --list
credential.helper=osxkeychain
user.name= yourName

OK!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值