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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:55:27+00:00 2026-06-10T21:55:27+00:00

git 1.7.12 I want to mark all files below a given directory as assume-unchanged.

  • 0

git 1.7.12

I want to mark all files below a given directory as assume-unchanged.

  1. git update-index --assume-unchanged dir/ gives "Ignoring path."

  2. git update-index --assume-unchanged dir/* quickly fails because it will encounter files which are not being tracked, hence it gives "fatal: Unable to mark file" and quits.

  3. Try generating a list of files to mark. cd into the desired directory and then run git ls-files | tr '\n' ' ' | git update-index --assume-unchanged. This produces no error message, but it does not successfully mark the files. The first portion of the command, git ls-files | tr '\n' ' ', correctly produces a space delimited list of all the files I want to mark. If I copy and paste the output of that command onto the command-line, then the git update-index command works. What is not working with the pipes?

No, it is not sufficient for me to add dir to .gitignore. I need these files to be in the repository, but undesired changes will be made locally that need to be ignored so that users can do pulls.

  • 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-06-10T21:55:29+00:00Added an answer on June 10, 2026 at 9:55 pm

    git update-index wants the file names on its command line, not on its standard input.

    Step 1:

    cd into the folder you want to assume is unchanged

    Step 2:

    You can do either this:

    git update-index --assume-unchanged $(git ls-files | tr '\n' ' ')
    

    or

    git ls-files | tr '\n' ' ' | xargs git update-index --assume-unchanged
    

    Although, with either case, file names with spaces will be problematic. If you have those, you can use this:

    git ls-files -z | xargs -0 git update-index --assume-unchanged
    

    Edit: incorporated input from @MatthewScharley regarding git ls-files -z.

    Windows Commands

    Note: If you’re on windows, use Git Bash to run these commands

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

Sidebar

Related Questions

I want to remove all files from Git at ~/bin/. I run git rm
i just want to update my local files with git. but every time i
I want to tell git to ignore e.g. jpg files regardless of how the
I want to send .patch files that were generated by the git format-patch command
I'm using Git and want to get rid of all my current changes and
git branch -a --contains <hash> gives me all those branches containing hash . what
Is there a way to have a git ignore file to ignore all files
I'm totally new to git and want to create a repository in a directory
I'm a newbie at git and want to understand how to collaborate with a
I basically want to do: git checkout branchA git checkout -b branchB <commit_id> which

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.