Follow

you shouldn’t be using git in a way where it would affect your workflow

@aescling Sometimes I don't need a thousand lines of git status for a directory I should be ignoring.

@aescling But I also want it to catch files that need to be added and I missed.

@aescling What?? :psyduck:

Then how am I supposed to tell Git to ignore my Vim .swp files?

@aescling I just use regular git add most of the time

But what's the point, what would it get me not to use the feature that specifically is there to prevent files from being added to the git repository to prevent files that I don't want to be added to the git repository from being added to the git repository?

@vaporeon_ to make a habit of adding files, and even more pawerfully, specific changes deliberately

@vaporeon_ the latter is what git add -p (that is, --patch) is designed to make pawsible to do

@aescling I probably should look into git add -p at some point, if I ever care about having a proper commit history where each commit is a particular change or set of changes...

@aescling It sure is easier to add files deliberately when git status doesn't show me a lot of files that I don't care about, such as compiled binaries and Vim .swp files. And that's why I add those to .gitignore, so that git status only shows the status that I actually care about!

@vaporeon_ ftr, you can tell vim to store all swapfiles in a purrticular directory (e.g., set directory=~/.vim/swap// (double slash intentional)) if you want to avoid littering swap files all over the filesystem

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.