gbp-setup-gitattributes(1)

πŸ’– gbp-setup-gitattributes β€” the git-buildpackage manual, bestie edition πŸ’–

okay so you found your way into the gbp-setup-gitattributes(1) page of the git-buildpackage Manual and honestly? you're in the right place. let's get into it πŸŽ€


✨ NAME ✨

gbp-setup-gitattributes β€” Set up Git attributes for packaging


✨ SYNOPSIS ✨

gbp setup-gitattributes [--version] [--help] [--verbose]
                        [--color=[auto|on|off]] [--color-scheme=COLOR_SCHEME]
                        [--[no-]dgit-defuse-attrs] [--all]

✨ DESCRIPTION ✨

so gbp setup-gitattributes sets up .git/info/attributes in the current Git repository, and it fills it with sane defaults that are the most suitable for packaging work. at the moment, that basically means making sure no transformations happen during checkout, commit or export. more attributes might get added in the future, but by default all known settings are applied. πŸ’…

here's the tea though πŸ“: upstream sources may ship .gitattributes files that enable certain transformations on the committed source β€” usually so the upstream authors have an easier time working with files in different encodings. cute for them! but for Debian packaging, it's necessary to override these attributes, because they often cause unwanted conversion of files (e.g. line endings, encodings and some others). working with a source tree like that is straight up confusing, because the working tree differs from the Git history (and sometimes from the source tarball), and it can lead to errors. not the vibe. πŸ’€

by default, gbp clone tries to detect the usage of .gitattributes in the upstream source and disables the Git attributes only when necessary. icon behaviour, honestly. πŸ‘‘


✨ OPTIONS ✨

  • --version β€” print the version of the program, i.e. the version of the git-buildpackage suite. that's it, that's the whole thing. πŸŽ€
  • -v, --verbose β€” verbose execution. it says more stuff. you get more lore. πŸ¦‹
  • -h, --help β€” print help and exit. the classic escape hatch. πŸ™ˆ
  • --color=[auto|on|off] β€” whether to use colored output. yes, no, or let it decide. πŸ’–
  • --color-scheme=COLOR_SCHEME β€” the colors to use in output (when color is enabled, obvs). the format for COLOR_SCHEME is '<debug>:<info>:<warning>:<error>'. numerical values and color names are both accepted, and empty fields imply the default color. for example, --git-color-scheme='cyan:34::' would show debug messages in cyan, info messages in blue and other messages in default (i.e. warning and error messages in red). lowkey a whole aesthetic. 🌈
  • --[no-]dgit-defuse-attrs β€” disables all transforming attributes for all files. how? by defining a macro attribute [attr]dgit-defuse-attrs and applying it to * together with export-subst and export-ignore. this method is compatible with dgit and git-deborig, which use this macro attribute. heads up bestie: older versions of dgit use an incomplete preset missing some attributes; if such a one is found, it gets replaced by an updated definition. glow-up, but make it a fix. ✨
  • --all β€” apply all known Git attribute settings. this is the default, so like, you already have it, but slay for being explicit. πŸ‘‘

✨ SEE ALSO ✨

gbp-clone(1), gbp-push(1), gbp.conf(5), gitattributes(5), dgit(7)

go read those too, iykyk 🫢


✨ AUTHOR ✨

Andrej Shadura <andrew@shadura.me> β€” thank you for your service, we are obsessed. πŸ’œ


and that's the whole page, bestie!! this was the gbp-setup-gitattributes(1) page from the git-buildpackage Manual, dated 26 May 2026. periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from