TypechoJoeTheme

Yuuuuuu

搜索到 3 篇与 的结果
2018-10-24

Git莫名其妙出现一大堆modified的解决办法

Git莫名其妙出现一大堆modified的解决办法
Git是个好东西。每次部署项目到服务器,都是使用Git,方便快捷。但是我发现一个文件。每次我刚部署完服务器,然后再git status看一下文件状态,就发现一堆不得了的问题。明明我什么都没改,却莫名其妙出现了一大堆未提交文件我打算看一下到底被修改了什么鬼东西。首先挑个文本文件看看,返回如下信息:old mode 100644new mode 100755再换一个apk,还是这样old mode 100644new mode 100755看来所有文件都是这个原因。明白了。由于项目需求,我在部署到服务器上之后,批量修改了一次文件权限chmod 755 -R xxx导致这几个文件的权限由原来的644被改成755,而Git默认是会监听文件属性的修改的,而文件属性中又包含了权限,这也就导致了我明明没修改任何文件的情况下却出现了一大堆未提交文件。上网Google了一下,最后决定关闭Git的文件属性监听git config core.filemode falseworking directory clean,世界清静了
2018年10月24日
1,649 阅读
0 评论
2018-02-28

.gitignore

.gitignore
如果是已经commit之后修改.gitignore,是不会立刻生效的,需要使用git rm -r . --cached清除一下缓存区,然后git add -Agit commit另外有关于C#的.gitngnore模板.vs /build/ *.suo *.user _ReSharper.*/ *.sdf bin/ obj/ Debug/ Release/ *.opensdf *.tlog *.log TestResult.xml *.VisualState.xml Version.cs Version.h Version.cpp以及需要更多的话,可以查看https://github.com/github/gitignorehttps://github.com/github/gitignore/blob/master/VisualStudio.gitignore
2018年02月28日
1,250 阅读
0 评论
2018-02-07

Git提示The file will have its original line endings in your working directory.

Git提示The file will have its original line endings in your working directory.
执行 git add提示的时候常常会提示The file will have its original line endings in your working directory.网上很多人都有这种情况,却都忽略。因为它确实没有必要,只是Linux平台下的换行符是 LF,而Windows下则是 CRLF,所以当你再 Windows 保存文件时候,换行符会被保存为LF不过看起来有一大串警告很不舒服就这么解决吧在git命令行里使用这一句,禁止自动转换换行符git config --global core.autocrlf false
2018年02月07日
1,728 阅读
1 评论