Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 159649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:53:47+00:00 2026-05-11T10:53:47+00:00

Due to external weird constraints I cannot modify the .gitignore of my repository. Is

  • 0

Due to external weird constraints I cannot modify the .gitignore of my repository. Is there a way to ignore files and directories other than modifying a .gitignore? Even if it is a global solution like a global configuration that will be applied to all my repositories.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:53:47+00:00Added an answer on May 11, 2026 at 10:53 am

    Do not forget, according to gitignore, that there is an order of precedence in the different ‘ignore pattern sources’ that Git consider:

    • Patterns read from the command line for those commands that support them.
    • Patterns read from a .gitignore file in the same directory as the path, or in any parent directory, with patterns in the higher level files (up to the root) being overridden by those in lower level files down to the directory containing the file.
    • Patterns read from $GIT_DIR/info/exclude.
    • Patterns read from the file specified by the configuration variable core.excludesfile.

    The last two can be a solution for your problem but:

    • they are not replicated for a distant repository
    • they can have their patterns overridden by the other sources

    (See also this SO question)


    The other two solutions involve updating the index (git update-index):

    • git update-index --assume-unchanged: see ‘Git: untrack a file in local repo only and keep it in the remote repo‘.
      It is mentioned by Elijah Lynn in the comments.
      • You can even ignore a folder content: ‘git update-index --assume-unchanged on directory‘.
      • Use --no-assume-unchange to reverse the effect: See ‘Is it possible to git add a file currently protected by assume-unchanged?‘.

    However, when you checkout another branch or when you git pull, that ‘ignore’ status might be reset. Hence the other option:

    • git update-index --skip-worktree; see:
      • ‘ignore my changes in files but don’t delete them from remote rep‘ and
      • ‘Preserve git –assume-unchanged files between branch checkouts‘.

    The difference between the two is explained in ‘Git – Difference Between ‘assume-unchanged‘ and ‘skip-worktree‘‘.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to load an external website in an iframe. But faced issues due
Due to a number of constraints that I won't get into, I have to
Due to a harddrive crash, I lost my SQL server database files for a
I am loading data from external html files within my domain into a div
I'm wondering how to call an external program in such a way that allows
I'm trying to put tag into JQuery-ui dialog widget. Due to some other problems
Sometimes my beans are not able to initialized properly due to external factors. Such
Due to an integration with an external system during the checkout I need to
Due to a sad situation I receive HTML like this: <p>Perform the following commands:
Due to legacy reasons a lot of our data is stored encoded in standard

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.