gbp-setup-gitattributes

&dhsection;

gbp-setup-gitattributes

Set up &git; attributes for packaging

          &gbp-setup-gitattributes;

          &man.common.options.synopsis;
          --[no-]dgit-defuse-attrs
          --all

## DESCRIPTION

&gbp-setup-gitattributes; sets up `.git/info/attributes` in the current &git; repository to sane defaults most suitable for packaging work. At the moment, this amounts to making sure no transformations happen during checkout, commit or export. More attributes may be added in future, by default all known settings are applied.

Upstream sources may ship `.gitattributes` files enabling certain transformations to the committed source, usually to make working with files in different encodings more convenient for the upstream authors. For Debian packaging, it is necessary to override these attributes, since they cause often unwanted conversion of files (e.g. line endings, encodings and some others). Working with such source tree is confusing, since the working tree differs from the Git history (and sometimes from the source tarball), and can lead to errors.

By default, &gbp-clone; tries to detect the usage of `.gitattributes` in the upstream source and disables the Git attributes only when necessary.

## OPTIONS

&man.common.options.description;

`--[no-]dgit-defuse-attrs`

- `Disables all transforming attributes for all files. This is done 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. Older versions of `dgit` use an incomplete preset missing some attributes; if such is found, it is replaced by an updated definition.

`--all`

- Apply all known &git; attribute settings. This is the default.

## SEE ALSO

man.gbp.clone, man.gbp.push, man.gbp.conf,

gitattributes

5 ,

dgit

7

## AUTHOR

Andrej Shadura andrew@shadura.me