Hi,

On 28/10/2021 08:55, Hanno Böck wrote:
> On Tue, 26 Oct 2021 14:41:01 -0400
> Mike Gilbert <flop...@gentoo.org> wrote:
>
>> Oops, I accidentally committed my vim swap file. I have fixed this
>> locally.
>
> Should we add *.swp (and a few others like *~, *.bak, *.orig) to
> .gitignore to avoid this from happening again?

I think it's best if people put their editor's temporary/backup
files in their local gitignore, instead of trying to maintain a
giant per-repository ignore file that needs amending for every
user's favourite editor.

For example, in ~/.gitconfig:

    [core]
    excludesFile = ~/.gitignore

Then ~/.gitignore can contain:

    *.swp
    *.bak
    *.orig

Thanks,
Matthew

Reply via email to