TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: make git ignore certain changed files in repo

11 pointsby falseover 13 years ago

5 comments

waffle_ssover 13 years ago
These are the aliases I have set in my .gitconfig for a similar (same?) purpose:<p><pre><code> [alias] ignore = !git update-index --assume-unchanged unignore = !git update-index --no-assume-unchanged ignored = !git ls-files -v | grep "^[[:lower:]]" </code></pre> Usage: `git ignore foo.rb`, `git unignore foo.rb`; `git ignored` to list all currently ignored files.
评论 #3033077 未加载
jcsalteregoover 13 years ago
For those who aren't familiar with the git subcommand, `git update-index --[no-]assume-unchanged` is at the core of this script.<p>It's useful for ignoring checked-in files <i>locally</i>, such as overriding app config settings for a local dev server.
评论 #3032142 未加载
joemiover 13 years ago
I'm a little confused by what this does... Can't you just not 'git add' a file to have git ignore its changes?
评论 #3031799 未加载
评论 #3031801 未加载
pavel_lishinover 13 years ago
I'm going to try this next week; this is something we could use at work.<p>Plus, can't beat the license.
评论 #3031771 未加载
angelbobover 13 years ago
Nice! I remember being surprised that .gitignore didn't do this.
评论 #3031790 未加载