Skip to content

Instantly share code, notes, and snippets.

@reduktr
Last active June 27, 2024 04:16
Show Gist options
  • Save reduktr/ed0ae4027967d50262e3bdd109fa8284 to your computer and use it in GitHub Desktop.
Save reduktr/ed0ae4027967d50262e3bdd109fa8284 to your computer and use it in GitHub Desktop.
Hiding README.md locally on a Bare Git Repository in your Home Directory

As of some newer Git version, sparse-checkout doesn't use patterns anymore but directories as arguments.

So to get the same functionality as earlier, one has to use

yadm sparse-checkout set --non-cone '/*' '!README.md' '!UNLICENSE.md'

but then it works as expected.

This even can be used in bootstrapping if you cd $HOME before.

The reasoning behind the change in git sparse-checkout and the downsides of using --non-cone mode can be found here: https://www.git-scm.com/docs/git-sparse-checkout#_internalsnon_cone_problems But these shouldn't affect us for (usually) small dotfile repositories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment