git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Ignore updates to files which are ignored, even if they're indexed.
@ 2016-05-18  1:07 Josh McCullough
  2016-05-18  6:38 ` Johannes Schindelin
  0 siblings, 1 reply; 2+ messages in thread
From: Josh McCullough @ 2016-05-18  1:07 UTC (permalink / raw)
  To: git

TL;DR: Git should ignore files if they are in `.gitignore`, regardless
of whether or not the file has changed (or been removed).

Use Case

An initial set of "local" config files are committed to a repo. Each
developer will pull down this set of files, but changes will be
auto-ignored unless the file is force-added after a change is made.

Current Workarounds

1) Use `git update-index --assume-unchanged local-config.xyz` to
ignore local changes to the file.
2) Add templates instead (local-config.template.xyz) and tell each
developer to copy these templates and remove the ".template" portion
of the file name. The file name without the ".template" portion is
added to `.gitignore`.

The current workarounds rely on the developer to know/remember what to
do. It would be nice if we could do this instead:

1) Create the initial `config-local.xyz`.
2) Add the new file to the index (`git add`).
3) Add the same path to `.gitignore`, and add the changes to the index.
4) Commit the staged changes.
5) Edit the `config-local.xyz` file.
6) Run `git status` -- git will not suggest that the file was changed
since it is in the `.gitignore`. If 7) The user specifically made
changes they wish to commit, the can force-add the ignored file.

Doing a search for [git commit file only once then ignore changes]
will show that other people wish for the same feature.


Thanks!


----- ----- -----

Side note: It took me 4 tries to get this email to go through, since
non-plain-text messages are strictly forbidden by this mailing list. I
use Inbox, which doesn't have an option to ensure a message is sent as
plain text. I had to switch back to GMail to get it to go through.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-18  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-18  1:07 Ignore updates to files which are ignored, even if they're indexed Josh McCullough
2016-05-18  6:38 ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).