0 votes
1 view
in DevOps and Agile by (30k points)

What is the correct way to make git ignore temporary files produced by vim in all directories (either globally across the system or locally for a single project)?

1 Answer

0 votes
by (51.2k points)

You can add vim files to .gitignore file because vim files end with ‘~

It can also create swap files that have the swp and swo extensions. To remove those you can use the lines:



Which helps you to ignore all temporary vim files from a project.

For ignoring  globally, you can create a .gitignore file in your home and use the following command:

git config --global core.excludesfile ~/.gitignore

Then you just need to add the files that you want to ignore. Thus, git ignore your temporary vim files.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !