Skip to content

Commit cb6e352

Browse files
committed
Add documentation re: working with symlinks to development guide
1 parent 001b6a0 commit cb6e352

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

content/_topics/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
This folder contains post content that is published in multiple forum topics.
44

55
The contents are targets of symlinks placed in the appropriate locations in the category structure.
6+
7+
Instructions for development work involving these symlinks are provided in the [**Development Guide**](../../docs/development.md#working-with-symlinks).

docs/development.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,67 @@
11
# Development Guide
22

3+
## Working with Symlinks
4+
5+
Identical copies of some of the content maintained in this repository is published in multiple forum topics. In order to avoid the need to maintain duplicated content in this repository, a single asset is used, with a [symbolic link](https://wikipedia.org/wiki/Symbolic_link) (AKA "symlink") to the asset placed in each of the locations in the category content tree ([example](../content/categories/community/general-discussion/_topics/how-to-get-the-best-out-of-this-forum)).
6+
7+
For certain development operations, it might be necessary to work with the repository's existing symlinks or add new ones.
8+
9+
---
10+
11+
**** If your local development work does not involve the project's symlinks, no action is required and you can skip the rest of this section.
12+
13+
---
14+
15+
### Linux or macOS
16+
17+
The Linux and macOS operating systems support symlinks by default so no preparation is required of contributors using these operating systems.
18+
19+
<a name="enable-windows-symlinks"></a>
20+
21+
### Windows
22+
23+
Windows supports symlinks, but by default support for creating symlinks is only available in administrative sessions (e.g., application used to work with the symlinks invoked via "**Run as administrator**").
24+
25+
Windows can be configured to allow creating symlinks even from non-administrative sessions:
26+
27+
https://learn.microsoft.com/windows/apps/get-started/enable-your-device-for-development
28+
29+
#### Git
30+
31+
If a repository is [cloned](https://docs.github.com/repositories/creating-and-managing-repositories/cloning-a-repository) when **Git** does not have the privileges needed to create symlinks, it will create placeholder text files in place of the symlinks. The content of the text file is the path to the symlink's target.
32+
33+
This behavior is controlled by **Git**'s [`core.symlinks` configuration variable](https://git-scm.com/docs/git-config/#Documentation/git-config.txt-coresymlinks). The variable will be set to `false` in the repository's [local configuration](https://git-scm.com/docs/git-config/#Documentation/git-config.txt-GITDIRconfig).
34+
35+
This behavior doesn't pose any problems if your development work won't involve the project's symlinks (the placeholders files for the existing symlinks are not treated as a [repository diff](https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-comparing-branches-in-pull-requests)), but will not be appropriate when you are working with the symlinks since we must commit functional symlinks rather than the placeholder files.
36+
37+
Even when the necessary privileges are present, the fallback behavior will be used when cloning the repository if `core.symlinks` is set to `false` in your [system](https://git-scm.com/docs/git-config/#Documentation/git-config.txt-prefixetcgitconfig) or [global](https://git-scm.com/docs/git-config/#Documentation/git-config.txt-XDGCONFIGHOMEgitconfig) **Git** configuration. You can check the value of the configuration variable by running this command:
38+
39+
```text
40+
git config --get --show-origin --show-scope core.symlinks
41+
```
42+
43+
And if it is set to `false`, you can change the value to `true` with this command:
44+
45+
```text
46+
git config --global core.symlinks true
47+
```
48+
49+
#### Git Bash
50+
51+
Contributors using Windows are recommended to use the excellent open source [**Git Bash**](https://gitforwindows.org/#bash) shell (installed as part of [**Git for Windows**](https://git-scm.com/download/win)).
52+
53+
If you have not [configured Windows](#enable-windows-symlinks) to provide default support for symlinks, an [additional configuration](https://cygwin.com/cygwin-ug-net/using-cygwinenv.html#:~:text=winsymlinks%3Anative%20and-,winsymlinks%3Anativestrict,-is%20this%3A%20If) of the shell is required in addition to using an administrative session. You can configure the current session to support creation of symlinks by running this [`export`](https://www.man7.org/linux/man-pages/man1/export.1p.html) command:
54+
55+
```text
56+
export MSYS=winsymlinks:nativestrict
57+
```
58+
59+
---
60+
61+
**** This additional configuration is not required if you are using Windows [**PowerShell**](https://learn.microsoft.com/powershell/scripting/learn/ps101/01-getting-started) instead of **Git Bash**.
62+
63+
---
64+
365
## Add or Remove a Pinned Topic
466

567
"Pinned" topics are always shown at the top of the category's listing.

0 commit comments

Comments
 (0)