We can apply certain safe and baseline defaults for `.gitattributes`(and `.vscode/settings.json`) for VyOS repositories on GitHub for improved developer experience.
These are mostly about aesthetics and are completely optional and don't affect VyOS operation in any way.
These `.gitattrbutes` settings are based on
- Git documentation (https://git-scm.com/docs/gitattributes#_effects)
- GitHub documentation (https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings)
- Community templates (https://github.com/gitattributes/gitattributes)
While on this, we can also adjust some of the VSCode settings (`.vscode/settings.json`) by removing the editor-agnostic ones (that would already be available in `.gitattributes`), and overriding the editor defaults selectively.
> **Note to developers:**
> 1. Since this PR affects the line-endings of files, once this PR is applied, one might need to reset the local git working tree from the local git index (after necessary care to `stash` or temporarily `commit` the local changes) by performing the following operations in the working directory:
>
> ```
> git rm -rf --cached .
> git reset --hard HEAD
> ```
> [[ https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings | GitHub article ]] has more details on this.
>
> 2. In case there are local files that are "in flight" and haven't been applied upstream yet, performing the following operation on the working directory would normalize the line endings:
> ```
> g add --renormalize .
> git status # Show files that will be normalized
> git diff | cat -v # Show the changes with the lin-endings (just to make sure)
> git commit -m "<coming message>"
> ```