git commit 过程中error或warning

1、 warning: LF will be replaced by CRLF

解决办法:

$ git config [--gobal] core.autocrlf false
原因:

CRLF -- Carriage-Return Line-Feed 回车换行。系统提示:LF 将被转换成 CRLF。

回车(CR, ASCII 13, \r)换行(LF, ASCII 10, \n)。

在Windows中广泛使用来标识一行的结束。而在Linux/UNIX系统中只有换行符。

也就是说在windows中的换行符为 CRLF, 而在linux下的换行符为:LF

使用git来生成一个工程后,文件中的换行符为LF, 当执行git add .时,系统提示:LF 将被转换成 CRLF。


2、git commit error:pathspect 'commit' did not match any file(s) known to git.

git commit -m "something".
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple
解决方法:

$ git config [--global] push.default matching

原因:

‘matching’ 参数是 Git 1.x 的默认行为,如果你执行 git push 但没有指定分支,它将 push 所有你本地的分支到远程仓库中对应匹配的分支。

Git 2.x 默认的是 simple,意味着执行 git push 没有指定分支时,只有当前分支会被 push 到你使用 git pull 获取的代码。

根据提示,修改git push的行为。




评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值