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 5844757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:20:18+00:00 2026-05-22T12:20:18+00:00

I have used git update-index –assume-unchanged on some files to keep my changes to

  • 0

I have used git update-index --assume-unchanged on some files to keep my changes to them from being committed.

When using git stash in the repository, those changes are stashed along with any other outstanding changes. This is expected behaviour, however git stash pop doesn’t bring them back, so the changes are just lost.

Anyone know how to either prevent the files with the assume unchanged bit from having their changes stashed? Alternatively perhaps you know how to make sure that any changes that are stashed against those files are at least brought back?

  • 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. Editorial Team
    Editorial Team
    2026-05-22T12:20:18+00:00Added an answer on May 22, 2026 at 12:20 pm

    assume-unchanged is a performance hack, and represents a promise from you that the file has not changed. If you actually change the file all bets are off. You should either rearchitect your repo so that you don’t commit these files (perhaps commit filename.sample and .gitignore filename) or play tricks with branches so that the files you do not want shared with the rest of the world are off on another branch or otherwise hidden.

    I have seen/thought of four suggestions on how to hide these changes.

    1: Use a smudge/clean filter to change the file to what you want on checkout and clean it on checkin. Ugly.

    2: Create a local configuration branch as described in http://thomasrast.ch/git/local-config.html The critical thing to remember here is that you develop on the primary branch and merge onto the config branch for testing. Back out to the primary branch to change, push, etc.

    3: Create a private development branch, make the change you never want shared, and then make a fake merge (git merge -s ours privatebranch). You can then develop and test on your private branch and the change you do not want shared should not be when you merge back, as long as the change is far away from your normal work. However, when you get new changes from upstream, you need to pull them directly from upstream into the private branch. You then merge from private back into master and push upstream from master. You must never merge from master back into private. Likewise, you must never rebase (well, possibly rebase -p would work, but no guarantees). These merge/rebase and where each must occur makes this less attractive.

    4: Create a private development branch, make the change you never want shared, and then create a merge driver (see man gitattributes) which will refuse to merge the file in question from master to private or from private to master (probably by comparing the SHA of the file on the private branch to the various branch’s SHAs and copying the previous value if it matches).

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

Sidebar

Related Questions

I've used ( and still use ) mercurial and git. I have some repos
I have git status reporting numerous files deleted from my sandbox: # deleted: prj1/.classpath
I recently switched to command-line git for my personal projects. I have used 3-way
I have used Phonegap.1.2.0.js in Window Phone 7 application. All files related html5 and
I'm not clear on what the following means (from the Git submodule update documentation):
I have recently extracted a few subdirectories from a shared git repository with git
I have a git repository on an OS X server that used to work
We have a new git repo that is acrued from a svn repo. The
We have a repository that was exported from subversion into git. This repository is
I hear all this stuff about bazaar being slower than git. I haven't used

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.