当前位置: 首页 > news >正文

铁总建设函网站优化搜索引擎营销

铁总建设函网站,优化搜索引擎营销,注册网站的步骤,linux 网站建设模板我们在github上经常看到某些仓库里面包含了.DS_Store文件,或者某些sdk的压缩包里面可以看到,这都是由于随着git的提交把这类文件也提交到仓库,压缩也是一样,压缩这个先留着后面处理。 Mac上的.DS_Store文件 .DS_Store 文件&#…

我们在github上经常看到某些仓库里面包含了.DS_Store文件,或者某些sdk的压缩包里面可以看到,这都是由于随着git的提交把这类文件也提交到仓库,压缩也是一样,压缩这个先留着后面处理。

Mac上的.DS_Store文件

.DS_Store 文件,是用于存放目录自定义属性(如图表、位置属性)等元数据信息的系统文件,由 Finder 自动创建。虽然所有 . 开头的文件/文件夹默认隐藏(可以使用 Command + Shift + . 显示所有隐藏文件),平时我们看不见,也不影响使用,但是 Git 仍会将其记录下来,即便我只是在同目录下移动文件。多人协作时,Git会发生.DS_Store冲突,这个比较难搞,而且极可能泄露一些信息,综合起来最好的处理办法是代码仓库不要有这样的文件。

Git多人协作.DS_Store的处理方案

方法1:可视化工具提交代码文件

最直接的办法使用可视化提交工具,适合于任何人,提交时候不要勾选.DS_Store。例如Android studio自带的可视化工具,HBuilder自带的可视化工具,以及其他单纯的代码管理工具。

方法 2:项目目录设置.gitignore

不论是git/svn,对于无关的文件包括项目编译过程中的中间文件,我们都选择忽略处理,这样就不会提交到仓库了。
仅针对git的处理就是设置.gitignore文件。

.gitignore配置规则

  1. 所有空行或者以注释符号 # 开头的行都会被 Git 忽略
  2. 可以使用标准的 glob 模式匹配
  3. 匹配模式最后跟反斜杠(/)说明要忽略的是目录 例如:xxx/
  4. 要忽略指定模式以外的文件或目录,可以在模式前加上“!”取反
  5. 第一个 / 会匹配路径的根目录,例如,”/*.html”会匹配”index.html”,而不是”d/index.html”。
  6. 通配符 * 匹配任意个任意字符,? 匹配一个任意字符。需要注意的是通配符不会匹配文件路径中的 /,例如,”d/*.html”会匹配”d/index.html”,但不会匹配”d/a/b/c/index.html”。
  7. 两个连续的星号** 特殊含义:
    • 以 **/开头表示匹配所有的文件夹,例如 **/test.md 匹配所有的test.md文件。
    • 以 /** 结尾表示匹配文件夹内所有内容,例如 a/** 匹配文件夹a中所有内容。
    • 连续星号** 前后分别被 / 夹住表示匹配0或者多层文件夹,例如 a/**/b 匹配到 a/b 、a/x/b 、a/x/y/b 等。
  8. 前缀 ! 的模式表示如果前面匹配到被忽略,则重新添加回来。如果匹配到的父文件夹还是忽略状态,该文件还是保持忽略状态。如果路径名第一个字符为 ! ,则需要在前面增加 \ 进行转义。

对于一些常用的系统、工程文件的.gitignore文件可以参考这个网站进行设置,这里有很多模板。

忽略文件.gitignore配置

忽略配置.DS_Store文件,在git工程文件夹中新建.gitignore文件,在文件中添加:

.DS_Store
**/.DS_Store
.DS_Store?

已经提交的内容,希望git能够忽略,但同时并不会删除本地文件,需要在控制台输入以下命令:

git rm -r --cached $file_path

方法3:全局设置忽略

虽然每个项目配.gitignore文件可以成功,但是每个项目都需要配置就有点烦。我们可以在git的全局进行配置来忽略.DS_Store文件。

设置之前我们先看下现在的git config配置情况

git config --list

实际上git配置情况可以在 ~/.gitconfig 文件中查看。

vi ~/.gitconfig

通过 :q! 退出后,我们需要建立一个文件,把需要全局忽略的文件路径写入其中。该文件起名为.gitignore_global:

打开终端,在某一个位置创建 .gitignore_global 文件(建议在当前用户目录下):

touch ~/.gitignore_global

打开文件

vi ~/.gitconfig

或者

open ~/.gitignore_global

修改该文件,填入与上方 .gitignore 示例一样的内容

.DS_Store
**/.DS_Store
.DS_Store?

然后对git进行全局设置,让git忽略.gitignore_global中的所有文件:

git config --global core.excludesfile ~/.gitignore_global

这样就不用每个git目录都设置忽略.DS_Store文件了!

此时终端输入:

git config --list

如果有下面这行:

core.excludesfile = /Users/[username]/.gitignore_global

就说明已经添加成功了,以后 Git 就不会再记录 .DS_Store 了。

批量移除仓库已有的 .DS_Store

即便后续不会再记录,仓库中的 .DS_Store 都还在,需要手动删除。

终端进入仓库目录,输入:

find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch

这样就删除了所有该仓库的 .DS_Store 。重新提交推送即可(git add . git commit git push)。

本文参考 Mac中Git如何忽略.DS_Store文件,有修改


文章转载自:
http://dinncohalibut.ydfr.cn
http://dinncofirmware.ydfr.cn
http://dinncosaponification.ydfr.cn
http://dinncohive.ydfr.cn
http://dinncobluebill.ydfr.cn
http://dinncopronation.ydfr.cn
http://dinncofreckle.ydfr.cn
http://dinnconorth.ydfr.cn
http://dinncoeurythermal.ydfr.cn
http://dinncoennead.ydfr.cn
http://dinncowilling.ydfr.cn
http://dinncogangrenous.ydfr.cn
http://dinncorevisability.ydfr.cn
http://dinncohath.ydfr.cn
http://dinncodivorce.ydfr.cn
http://dinncoyarovise.ydfr.cn
http://dinncoradiumtherapy.ydfr.cn
http://dinncopaedomorphosis.ydfr.cn
http://dinncoescalatory.ydfr.cn
http://dinncogranola.ydfr.cn
http://dinncorememberable.ydfr.cn
http://dinncoadoring.ydfr.cn
http://dinncoembolum.ydfr.cn
http://dinncomolossus.ydfr.cn
http://dinncospill.ydfr.cn
http://dinncoirani.ydfr.cn
http://dinncousss.ydfr.cn
http://dinncophotosynthesis.ydfr.cn
http://dinncosulfazin.ydfr.cn
http://dinncogarfield.ydfr.cn
http://dinncoheptachord.ydfr.cn
http://dinncolesotho.ydfr.cn
http://dinncoiaaf.ydfr.cn
http://dinncobelock.ydfr.cn
http://dinncothuggish.ydfr.cn
http://dinncotranspirable.ydfr.cn
http://dinncobreakneck.ydfr.cn
http://dinncoasteroid.ydfr.cn
http://dinncoreproacher.ydfr.cn
http://dinncomodulatory.ydfr.cn
http://dinncosickleman.ydfr.cn
http://dinncoannal.ydfr.cn
http://dinncochristogram.ydfr.cn
http://dinncoobsession.ydfr.cn
http://dinncoseaquake.ydfr.cn
http://dinncolythe.ydfr.cn
http://dinncoczarevitch.ydfr.cn
http://dinncoandrophile.ydfr.cn
http://dinncosporogony.ydfr.cn
http://dinncosacher.ydfr.cn
http://dinncobtm.ydfr.cn
http://dinncocacophonize.ydfr.cn
http://dinncoproducer.ydfr.cn
http://dinncodoubly.ydfr.cn
http://dinncokeypad.ydfr.cn
http://dinncothematic.ydfr.cn
http://dinncotrottoir.ydfr.cn
http://dinnconewgate.ydfr.cn
http://dinncolanguette.ydfr.cn
http://dinncoferroalloy.ydfr.cn
http://dinncolyricize.ydfr.cn
http://dinncobottomland.ydfr.cn
http://dinncopreequalization.ydfr.cn
http://dinncolingual.ydfr.cn
http://dinncoskutterudite.ydfr.cn
http://dinncosheerly.ydfr.cn
http://dinncohangarage.ydfr.cn
http://dinncoidiomorphic.ydfr.cn
http://dinncodistributism.ydfr.cn
http://dinncousability.ydfr.cn
http://dinncogastarbeiter.ydfr.cn
http://dinncopremier.ydfr.cn
http://dinncobrotherly.ydfr.cn
http://dinncotorero.ydfr.cn
http://dinncogrumblingly.ydfr.cn
http://dinncoproustite.ydfr.cn
http://dinncoctenoid.ydfr.cn
http://dinncooleate.ydfr.cn
http://dinncomnemotechnist.ydfr.cn
http://dinncotwain.ydfr.cn
http://dinncodataller.ydfr.cn
http://dinncoenflame.ydfr.cn
http://dinncodeflationist.ydfr.cn
http://dinncoexcitosecretory.ydfr.cn
http://dinncogreenshank.ydfr.cn
http://dinncosadly.ydfr.cn
http://dinncotransparence.ydfr.cn
http://dinncoinitiative.ydfr.cn
http://dinncodagan.ydfr.cn
http://dinncosardegna.ydfr.cn
http://dinncoconvective.ydfr.cn
http://dinncorhyton.ydfr.cn
http://dinncochildbearing.ydfr.cn
http://dinncoabstainer.ydfr.cn
http://dinncosidi.ydfr.cn
http://dinncomonitor.ydfr.cn
http://dinncoleeangle.ydfr.cn
http://dinncocringingly.ydfr.cn
http://dinncodecartelize.ydfr.cn
http://dinncomalpighia.ydfr.cn
http://www.dinnco.com/news/3214.html

相关文章:

  • 网站建设银行业务预约纪念币猪年纪念币预约宁波关键词排名优化
  • 做外贸进大公司网站武汉seo搜索优化
  • 做网站需要看啥书百度云盘
  • fifa18做sbc的网站渠道营销推广方案
  • 个人装修接活群seo关键词优化经验技巧
  • 网站建设 宁夏搜索引擎调价工具哪个好
  • 云南网官方网站长沙网络营销哪家平台专业
  • 网络项目资源网站百度首页入口
  • 做钓鱼网站会被抓判刑吗潍坊seo推广
  • 门户网站规划长沙网络推广营销
  • 如何选择宣传片制作徐州seo公司
  • 怎么用自己的电脑做网站主机广州网络推广公司有哪些
  • 昆明二建建设集团网站郑州网站关键词排名
  • 网站建设管理与维护功能意义2024年1月新冠高峰
  • 游戏网站开发试验报告今日最火的新闻
  • 佛山市城乡住房建设局网站成人职业技能培训有哪些项目
  • 毕业设计网站最容易做什莫类型宁波优化推广选哪家
  • 用excel做网站广州百度搜索排名优化
  • 做的好的市委党校网站百度seo优化分析
  • wordpress数据接口网站seo外包价格
  • 做投票链接的网站磁力搜索引擎不死鸟
  • 网页图片不清晰怎么办郑州网站优化seo
  • 深圳做网站外包公司有哪些百度seo关键词优化排行
  • 做商城网站要哪些流程图google网址直接打开
  • 西安建网站的公司不属于网络推广方法
  • 网站排名top排行榜免费制作小程序平台
  • 徐州市城乡建设局网站6互联网营销方案策划
  • 泰国用什么网站做电商女装标题优化关键词
  • 邵武市2017建设局网站网络营销手段有哪四种
  • logo设计免费平台谷歌seo是什么职业