Most projects have automatically generated files or folders from the operating system, applications, package managers etc. Usually, we don't want to include these types of things in our remote repos because they can clutter the git history/storage and are not applicable to everyone that works on the project. In this lesson, we show how to create a .gitignore file to ignore files and folders from being tracked by git.

If before the files or folders are added staging area, we can add those into .gitingore file, so it won't be tracked.

But If we also add those file or folder into the staging area, we can run:

  1. git rm --cached

[Practical Git] Remove unnecessary git tracking with .gitignore files的更多相关文章

  1. Git学习之忽略特殊文件.gitignore的配置

    1.Mac中使用Git上传项目代码时忽略.DS_Store文件 简单的说Mac每个目录都会有个文件叫.DS_Store,它是用于存储当前文件夹的一些Meta信息.所以每次查看Git目录的状态,如果没有 ...

  2. git config --global core.excludesfile配置gitignore全局文件

    Linux中,这时把全局要忽略的文件列表.gitignore放当前用户根目录下: git config --global core.excludesfile '~/.gitignogtire' Win ...

  3. git忽视上传规则文件 .gitignore

    语法 语法 作用 例子 "/" 忽略根目录下的文件 /data "*" 忽略所有文件 *.txt => 1.txt,2.txt... "?&qu ...

  4. git遇到的问题 .Git: There is no tracking information for the current branch.

    1.Git: There is no tracking information for the current branch. 在执行git pull的时候,提示当前branch没有跟踪信息: git ...

  5. Git使用的一些问题:.gitignore规则不生效、git同步代码至github和gitee

    Git忽略规则及.gitignore规则不生效的解决办法 .gitignore 的基本使用 在git中如果想忽略掉某个文件,不让这个文件提交到版本库中,可以使用修改根目录中 .gitignore 文件 ...

  6. Github & DMCA Takedown & git remove history

    Github & DMCA Takedown & git remove history Github & DMCA Takedown Policy Removing files ...

  7. git忽略文件夹提交以及gitignore修改后不生效的解决办法

    1.在 .gitgnore 文件加入需要忽略的问价夹正则表达式: 在配置完以后提交代码,你可能会发现git忽略配置不生效! 解决办法,将缓存的文件重新添加一下即可 2.打开命令行,将下面三个命令复制粘 ...

  8. Git 学习之Git 基础(二)

    Git 基础 读完本章你就能上手使用 Git 了.本章将介绍几个最基本的,也是最常用的 Git 命令,以后绝大多数时间里用到的也就是这几个命令.读完本章,你就能初始化一个新的代码仓库,做一些适当配置: ...

  9. git rebase vs git merge详解

    https://medium.com/@porteneuve/getting-solid-at-git-rebase-vs-merge-4fa1a48c53aa#.std3ddz0g 请参考另外一篇文 ...

随机推荐

  1. 在Google被封的那些日子裏,我們這樣科學上網

    回到正題,如果某天你喜歡的網站被封了,你工作的郵箱無法訪問了,該如何用正確姿勢實現科學上網呢?雷鋒網為大家整理了數個小技巧. 1.FreeGate類傻瓜工具 很多人第一次用翻墻,應該是從FreeGat ...

  2. 【express】

    app.use(express.favicon(__dirname + '/public/images/favicon.ico'));不支持png格式

  3. RMAN备份与恢复实例

    1. 检查数据库模式:   sqlplus /nolog    conn /as sysdba   archive log list (查看数据库是否处于归档模式中) 若为非归档,则修改数据库归档模式 ...

  4. 记录一次Jmeter性能测试

    一.引言 之前有总结过如何写Java请求测试用例类,写完测试脚本调通之后,信心满满地以为我准备好可以开始性能测试了.结果在评审测试计划的时候,当即被项目组狠狠的扇了一耳光,各种不确定的点:性能指标不明 ...

  5. 十款PHP开发框架对比

    PHP开发框架近来在PHP社区中成为讨论的热点,几乎每天都在推出新的框架.面对市面上超过四十种的开发框架,你很难判断究竟哪一款最适合你,尤其是在这些框架所提供的功能不尽相同的时候.    本文将引导你 ...

  6. 给定金额m和红包数量n

    这一题如果是采用暴力手段,不一定能获得正确答案,而且也非常耗时. 所以下面我们采用一个小技巧,也就是先产生n-1个红包,总得sum<m的,这样最后只要添加一个sum-m的红包钱数就可以了. 具体 ...

  7. Mac安装wget的两种方法

    ​ 第一种.传统的安装包 A - 从ftp://ftp.gnu.org/gnu/wget/下载到最新的wget安装包到本地 B - 然后通过终端tar -zxvf命令解压到我们某个目录 C - 然后依 ...

  8. java@ What are C++ features missing in Java

    Following features of C++ are not there in Java. No pointers No sizeof operator No scope resolution ...

  9. eclipse下使用tomcat启动maven项目

    最近学习使用maven,建立了一个maven项目使用eclipse下tomcat启动时报错: 严重: ContainerBase.addChild: start: org.apache.catalin ...

  10. maven 约定

    pom.xml 放置在项目的根目录 在 src/main/java 中放置项目的主代码 在 src/main/resources放置主项目的资源 在 src/test/java 中放置项目的测试代码 ...