Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to Standardize Line Endings in Git Without Committing `.gitattributes`

When developing with Git, differences between CRLF and LF can become an issue when working across Windows and Linux/macOS. A common solution is to place a .gitattributes file in the repository to define line-ending rules. However, there are also cases where you may want to: Avoid adding .gitattributes to the repository Standardize line endings only in your own environment Apply the same rules…

When developing with Git, inconsistencies between CRLF and LF line endings can cause issues when collaborating across Windows and Linux/macOS systems. Instead of adding .gitattributes to every repository, you can configure line ending rules without committing the file.

For specific repositories, create a .git/info/attributes file and define the rules, such as:

* text=auto eol=lf

*.bat text eol=crlf

*.cmd text eol=crlf

This configuration treats regular text files as LF and Windows batch files (.bat, .cmd) as CRLF.

To apply common settings across all Git repositories, configure the global attribute file location:

git config --global core.attributesFile ~/.gitattributes

Then, create a file at ~/.gitattributes with similar rules:

* text=auto eol=lf

*.bat text eol=crlf

*.cmd text eol=crlf

Choose the appropriate method based on your needs: use .git/info/attributes for specific repositories, or the global configuration for an entire Git environment. If required, use .git/info/attributes for exceptional rules in a specific repository.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Recursion vs Iteration: Choosing Your Path Like Neo in The Matrix

The Quest Begins (The "Why") I was knee‑deep in a coding interview when the interviewer tossed me a seemingly innocent problem: “Given a binary tree, return the sum of all its nodes.” My first…

  • Binary trees are recursive data structures mirroring the problem definition.
  • Recursion offers a one-to-one mapping between problem description and code, reducing bookkeeping.
  • Iterative approach required manual stack management, making code longer and less intuitive.

Running Android VMs on ARM: Rebuilding the Minisforum MS-R1 Kernel for Cuttlefish

Part 1 of 2. This part covers getting a kernel that can actually host virtual machines. Why bother I wanted a box that could run a dozen Android instances at once — real ones, not emulated-on-x86 ones…

  • Author aims to run multiple Android instances on Minisforum MS-R1
  • Minisforum MS-R1 lacks vhost subsystem, disabling Cuttlefish functionality
  • cixtech/cixopensourcelinux branch enables vhost support for kernel 6.6.10

More from Monday 17 August →