zoukankan      html  css  js  c++  java
  • 为Git添加忽略文件

    用Eclipse PDT开发PHP时,Eclipse会自动创建几个系统文件。这些文件在Git提交时可以忽略。

    使用git status可以看到这些文件(.project, .buildpath和.settings):

    $ git status
    # On branch master
    # Untracked files:
    #   (use "git add <file>..." to include in what will be committed)
    #
    #    .buildpath
    #    .project
    #    .settings/
    #    includes/
    #    index.php
    nothing added to commit but untracked files present (use "git add" to track)

    怎么忽略呢?方法是创建.gitignore文件,将需要略过的文件名和目录名添加到.gitignore:

    $ cat .gitignore 
    .project
    .buildpath
    .settings

    再用git status查看,就看不到这几个文件了:

    $ git status
    # On branch master
    # Untracked files:
    #   (use "git add <file>..." to include in what will be committed)
    #
    #    .gitignore
    #    includes/
    #    index.php
    nothing added to commit but untracked files present (use "git add" to track)
  • 相关阅读:
    SpringBoot-14-MyBatis预热篇,MySQL小结
    SpringBoot-13-插曲之Node文件重命名+自动生成json对象
    八月十九风雨大作
    诉世书
    《仪式》
    珊瑚墓地
    新生
    《应龙》
    《枝·你是树的狂舞》
    golang中使用etcd
  • 原文地址:https://www.cnblogs.com/eastson/p/2688259.html
Copyright © 2011-2022 走看看