Skip to content

Commit 24d5123

Browse files
committed
Tweak line ending troubleshooting
1 parent 1f67fb6 commit 24d5123

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

docs/remote/troubleshooting.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,22 +270,24 @@ To change Docker's drive and folder sharing settings:
270270

271271
### Resolving Git line ending issues in containers (resulting in many modified files)
272272

273-
Since Windows and Linux use different default line endings, you may see files that appear modified but seem to have no differences aside from the line endings. To prevent this from happening, you can disable automatic line ending conversion. Just add a `.gitattributes` file to your folder and then run:
273+
Since Windows and Linux use different default line endings, you may see files that appear modified but seem to have no differences aside from the line endings. To prevent this from happening, you can disable automatic line ending conversion and optionally add a `.gitattributes` file to your folder. First, run:
274274

275275
```bash
276276
git config --global core.autocrlf false
277277
```
278278

279-
You will need to re-clone the repository for this setting to take effect.
280-
281-
Optionally, you can add the following contents to a `.gitattributes` file to force everything in the repo to use LF endings except for windows batch files that require CRLF:
279+
Next, you can prevent others from facing this issue regardless of their setting by adding or modifying a `.gitattributes` file in your repository. For example, this will force everything to be LF except for Windows batch files that require CRLF:
282280

283281
```yaml
284282
*.* text eol=lf
285283
*.{cmd,[cC][mM][dD]} text eol=crlf
286284
*.{bat,[bB][aA][tT]} text eol=crlf
287285
```
288286

287+
You can add other file types in your repository that require CRLF to this same file.
288+
289+
Finally, re-clone the repository for so these setting take effect.
290+
289291
### Avoid setting up Git in a container when using Docker Compose
290292

291293
To avoid having to set up Git a second time in your container, VS Code automatically adds a volume mount to your local Git configuration when referencing an `image` or `Dockerfile`. The Docker Compose scenario gives you more control, but in this case requires adding an extra configuration line to your `docker-compose.yml` file.
@@ -528,22 +530,24 @@ Some extensions rely on libraries not found in the vanilla install of certain WS
528530

529531
### Resolving Git line ending issues in WSL (resulting in many modified files)
530532

531-
Since Windows and Linux use different default line endings, you may see files that appear modified but seem to have no differences aside from the line endings. To prevent this from happening, you can disable automatic line ending conversion and add a `.gitattributes` file to your folder. Then run:
533+
Since Windows and Linux use different default line endings, you may see files that appear modified but seem to have no differences aside from the line endings. To prevent this from happening, you can disable automatic line ending conversion and optionally add a `.gitattributes` file to your folder. First, run:
532534

533535
```bash
534536
git config --global core.autocrlf false
535537
```
536538

537-
You will need to re-clone the repository for this setting to take effect.
538-
539-
Optionally, you can add the following contents to a `.gitattributes` file to force everything to be LF except for windows batch files that require CRLF:
539+
Next, you can prevent others from facing this issue regardless of their setting by adding or modifying a `.gitattributes` file in your repository. For example, this will force everything to be LF except for Windows batch files that require CRLF:
540540

541541
```yaml
542542
*.* text eol=lf
543543
*.{cmd,[cC][mM][dD]} text eol=crlf
544544
*.{bat,[bB][aA][tT]} text eol=crlf
545545
```
546546

547+
You can add other file types in your repository that require CRLF to this same file.
548+
549+
Finally, re-clone the repository for so these setting take effect.
550+
547551
## Extension tips
548552

549553
While many extensions will work unmodified, there are a few issues that can prevent certain features from working as expected. In some cases, you can use another command to work around the issue, while in others the extension may need to be modified. This section provides a quick reference for common issues and tips on resolving them. You can also refer to the main extension article on [Supporting Remote Development](/api/advanced-topics/remote-extensions) for an in-depth guide on modifying extensions when required.

0 commit comments

Comments
 (0)