Ignore updates to files which are ignored, even if they're indexed.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]