git、samba、git bash的一个问题
为情所困
为情所困 2017-05-02 09:23:08
0
3
661

问题描述:
我在虚拟机上面搭建了本地的web LAMP服务,虚拟机上已经安装了git,网站根目录为/var/www/web_root,该目录用samba映射到windows。

在windows下git clone了项目到samba映射的地方。 现在我用git bash 里面和虚拟机里面分别git status。

结果如下:

1--------------------- windows 下git bash 中git status结果
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

2--------------------- 虚拟机linux 下git status结果
[root@yangshushu jnexpertweb]# git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

。。。。。。 下面是很多的红色标识文件

windows下面git已经配置过(key放在远端git配置),虚拟机里面没配置过,不知道是不是这个原因,不明白怎么回事。
请教~~

为情所困
为情所困

reply all(3)
PHPzhong

It may be a problem with line breaks. Under Windows, a line break is two characters CRLF (carriage return + line feed), and under Linux, a line break is one character LF (line feed);
If a project under windows is cloned to Linux, git will wrap the line Characters are automatically processed to convert all CRLF into LF, which causes all files to change.
Solution: Disable git from automatically converting line breaks, or manually set git's line breaks

给我你的怀抱

There are too many differences in details between windows and linux. It is recommended to use linux instead of linux to avoid many pitfalls. . .

大家讲道理

I also encountered this problem. I don’t know the specific reason. Please continue to pay attention to this issue.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!