git commit 过程中error或warning

来源:互联网 发布:gis软件下载 编辑:程序博客网 时间:2024/05/23 11:50

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 inGit 2.0 from 'matching' to 'simple'. To squelch this messageand maintain the current behavior after the default changes, use:  git config --global push.default matchingTo 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的行为。




0 0
原创粉丝点击