Skip to content

Instantly share code, notes, and snippets.

@thiagobraga
Last active January 6, 2021 20:12
Show Gist options
  • Select an option

  • Save thiagobraga/d10feada3d42c95466d97560b3c94974 to your computer and use it in GitHub Desktop.

Select an option

Save thiagobraga/d10feada3d42c95466d97560b3c94974 to your computer and use it in GitHub Desktop.

Revisions

  1. thiagobraga revised this gist Jan 6, 2021. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,27 @@
    ## Ignorar alterações em arquivos com `update-index`

    ``` bash
    git update-index --assume-unchanged package.json
    git update-index --assume-unchanged resources/assets/sass/old_css/helper.css
    git update-index --assume-unchanged resources/views/errors/500.blade.php
    git update-index --assume-unchanged resources/views/layouts/admin/head.blade.php
    git update-index --assume-unchanged resources/views/layouts/admin/master.blade.php
    git update-index --assume-unchanged resources/views/layouts/student/head.blade.php
    git update-index --assume-unchanged resources/views/layouts/student/master.blade.php
    git update-index --assume-unchanged webpack.js.mix.js
    git update-index --assume-unchanged package.json
    ```

    ### Não ignorar alterações

    ``` bash
    git update-index --no-assume-unchanged package.json
    git update-index --no-assume-unchanged resources/assets/sass/old_css/helper.css
    git update-index --no-assume-unchanged resources/views/errors/500.blade.php
    git update-index --no-assume-unchanged resources/views/layouts/admin/head.blade.php
    git update-index --no-assume-unchanged resources/views/layouts/admin/master.blade.php
    git update-index --no-assume-unchanged resources/views/layouts/student/head.blade.php
    git update-index --no-assume-unchanged resources/views/layouts/student/master.blade.php
    git update-index --no-assume-unchanged webpack.js.mix.js
    git update-index --no-assume-unchanged package.json
    ```

    ## Incluir no `.git/info/exclude`
  2. thiagobraga revised this gist Dec 9, 2020. No changes.
  3. thiagobraga revised this gist Dec 9, 2020. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    # [Git] Como ignorar arquivos localmente sem incluir no .gitignore

    ## Ignorar alterações em arquivos com `update-index`

    ``` bash
  4. thiagobraga revised this gist Dec 9, 2020. 1 changed file with 36 additions and 1 deletion.
    37 changes: 36 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,36 @@
    ‎‎​
    # [Git] Como ignorar arquivos localmente sem incluir no .gitignore

    ## Ignorar alterações em arquivos com `update-index`

    ``` bash
    git update-index --assume-unchanged resources/views/errors/500.blade.php
    git update-index --assume-unchanged resources/views/layouts/admin/master.blade.php
    git update-index --assume-unchanged resources/views/layouts/student/master.blade.php
    git update-index --assume-unchanged webpack.js.mix.js
    git update-index --assume-unchanged package.json
    ```

    ### Não ignorar alterações

    ``` bash
    git update-index --no-assume-unchanged resources/views/errors/500.blade.php
    git update-index --no-assume-unchanged resources/views/layouts/admin/master.blade.php
    git update-index --no-assume-unchanged resources/views/layouts/student/master.blade.php
    git update-index --no-assume-unchanged webpack.js.mix.js
    git update-index --no-assume-unchanged package.json
    ```

    ## Incluir no `.git/info/exclude`

    Este caso é para arquivos _untracked_ pelo git. Como não é possível utilizar o `update-index` para um arquivo que ainda não foi versionado, podemos usar o arquivo `exclude` do git.

    ```ini
    # git ls-files --others --exclude-from=.git/info/exclude
    # Lines that start with '#' are comments.
    # For a project mostly in C, the following would be a good set of
    # exclude patterns (uncomment them if you want to use them):
    # *.[oa]
    # *~
    docker-compose.override.yml
    docker/php/xdebug.ini
    ```
  5. thiagobraga created this gist Dec 9, 2020.
    1 change: 1 addition & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ‎‎​