Back to News
Advertisement
Advertisement

⚡ Community Insights

Discussion Sentiment

80% Positive

Analyzed from 436 words in the discussion.

Trending Topics

#git#config#ignore#exclude#objects#global#user#done#machine#why

Discussion (19 Comments)Read Original on HackerNews

wpollock4 minutes ago
One point of clarification: with git, "global" means per-user, not "machine-wide. (I never understood why "--global" wasn't better named, maybe "--user".) That's why these pathnames are in a user's home (the "~" means the current user's home directory).

Machine-wide configuration is called "system" in git, and generally lives under "/etc".

hk1337about 1 hour ago
~/.config/git/ignore and ~/.config/git/config is the proper place for your global git config and ignore instead of creating a ~/.gitignore_global and changing the config. IMO.

my dotfiles are a lot smaller at the root level taking advantage of the ~/.config/ for a lot more things.

the git exclude isn't used as much because it doesn't get committed to the repository so you'd have to recreate it each time you wanted to use it. that doesn't mean they're bad just why they are not used.

b40d-48b2-979eabout 1 hour ago
As a bonus, you can (should?) version control your `~/.config` dir to enable future revisions and sharing.
hk133743 minutes ago
Absolutely. On that subject, I prefer the Atlassian method for storing dotfiles in git but sometimes I feel like it's Mootools vs jQuery all over again.
judofyrabout 1 hour ago
Not sure where I picked up this, but I’ve added this to my global Git ignore:

    attic
That way you can just create an attic directory in any project where you can keep random stuff that should never be committed. I’ve yet to find a repo which actually has such a directory checker in.
williamjacksonabout 1 hour ago
I do this too! But I call it `.local`
Hendriktoabout 2 hours ago
This is just a very low-effort regurgitation of this: https://git-scm.com/docs/gitignore
jagged-chiselabout 2 hours ago
Hey, come on now - they added 'check-ignore' which is good complementary advice.
_the_inflatorabout 1 hour ago
You made my day. Everything is said and explained there.

Ok, sometimes a more vivid and visually explanatory style would help, but here still Google is your friend for individual concepts.

One of the best resources there is. git is a hell of a tool. It looks simple but is so beautifully versatile without being complex or not deductive.

y2244about 1 hour ago
"Google is your friend for individual concepts."

Asking aLlm is the new google

b40d-48b2-979eabout 1 hour ago

    git is a hell of a tool. It looks simple but is so beautifully versatile without being complex

    without being complex
Uh, what?
raframabout 1 hour ago
What part of

   Enumerating objects: 15, done.
   Counting objects: 100% (15/15), done.
   Delta compression using up to 10 threads
   Compressing objects: 100% (8/8), done.
   Writing objects: 100% (8/8), 1.43 KiB | 1.43 MiB/s, done.
   Total 8 (delta 7), reused 0 (delta 0), pack-reused 0 (from 0)
   remote: Resolving deltas: 100% (7/7), completed with 7 local objects.
don't you understand?!
jeremyscanvic32 minutes ago
I knew about .git/info/exclude and ~/.config/git/ignore but not about git-check-ignore(1). Neat!
bryancoxwellabout 2 hours ago
I use the ever living hell out of .git/info/exclude. Works great for scripts/Makefiles I only want locally and collaborators wouldn’t care about or be able to use.
RSHEPPabout 1 hour ago
Interested in examples of the types of scripts others collaborators wouldn't be able to use? Like scripts for PR workflows?
junonabout 1 hour ago
Usually when I'm working in one part of the codebase and I have sample data or something at a specific path on my local machine and Im testing the same thing over and over again will I make a Makefile or something and info/exclude it to help me keep focused. That's one way I use it.
bryancoxwell42 minutes ago
Yeah this is pretty much it.
barbazoo23 minutes ago
Exclude sounds like a recipe for sadness.
bitvvipabout 1 hour ago
I still like using gitignore very much