Skip to content

Commit b7fed9c

Browse files
committed
✒ Update git config to support new credentials option and lookup for .git-credentials.
1 parent 14ff6aa commit b7fed9c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

documentation/systemProvisionGuide/Guide to setting up Windows environment for development.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ localhost:8083 test.localhost
197197
- Run docker containers:
198198
- run portainer with autostart. (run portainer from @deployment/deploymentScript package.)
199199
- Turn on WSL2 integration of Docker Desktop.
200-
- Solve issue, every now and then the WSL2-Docker integration breaks: Make sure DOCKER_HOST environment is not set, Or reinstall docker or https://github.com/docker/for-win/issues/5096#issuecomment-572730439
200+
- Solve issue, every now and then the WSL2-Docker integration breaks:
201+
- Remove containers with socket attached, disable WSL2 Docker and then re-enable it, & restart computer (complete shutdown, not logging out)
202+
- Make sure DOCKER_HOST environment is not set, Or reinstall docker or https://github.com/docker/for-win/issues/5096#issuecomment-572730439
203+
- IMPORTANT: Should add delayed startup for docker desktop to prevent failure of setting up itself with WSL2. Otherwise, WSL2 docker commands will not be able to connect to Docker deamon. Add delay to startup program using Windows Patrol program.
204+
201205

202206
### Winrar:
203207
- Settings > Integration > Cascaded context menu.
@@ -263,7 +267,8 @@ ___
263267
- `yarn run provisionOS` run it through Windows Node's installation, rather than under the newly installed WSL.
264268
once reached `change default shell` exit the new zsh shell that will be opened to continue installation. Repeat execution if errors occur, and make sure all commands in installations where executed (e.g. powerlevel10K theme in ZSH command group). this command will also update linux `sudo apt update -y && sudo apt upgrade -y`
265269
- Make sure the apppDeploymentLifecycle scripts don't mess up some changes made by Docker on WSL2 and VSCode remote server for WSL2. If Issues found try disabling and reenabling docker engine on WSL2 and to trigger reinstallation.
266-
- Symlink .ssh folder to WSL: `sudo ln -s /<.ssh location>/.ssh /root/.ssh`
270+
- Symlink .ssh folder to WSL: `sudo ln -s /<.ssh location>/.ssh ~/.ssh`
271+
- git will use 'credential store' (resource > .gitconfig) to lookup for `.git-credentials` file and automatically read token for github. Make sure .git-credentials have the current user as owner and has permissions (-rw-------), instead of root (which will allow usage without sudo),.
267272
- Setup VSCode in WSL2: ctrl+shift+p and search for "Remote: WSL new window", in which VSCode will download WSL server automatically and set it up.
268273
- make sure `code .` or `code-insiders .` works in WSL2 after vscode installed VSCode server in WSL2.
269274
- Open extensions tab, and migrate all required extensions to debian side in order to enable them.
@@ -276,6 +281,7 @@ ___
276281
- Split repositories between Windows and WSL2: Move most repositories to WSL2 filesystem for greater performance, and keep Window system provisioning and documentation related repositories in Windows.
277282

278283
Notes & Resources:
284+
- Access root user in WSL2 with `sudo su`
279285
- An attempt to install WSL2 in insiders program (slow ring):
280286
- OS biuld before switching to insiders = 18363.592 (version 1909) or 18363.628
281287
- OS build after switching to insiders = 19041.21

resource/localDevelopmentEnvironment/WindowsSubSystemForLinux/.gitconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
[user]
22
# name =
33
# email =
4+
5+
# stores credentials for interacting with github
6+
# .ssh must be symlinked to the WSL filesystem
7+
[credential]
8+
helper = store --file ~/.ssh/.git-credentials
9+
410
[core]
511
autocrlf = false
612
excludesfile = ./configuration/.gitignore

0 commit comments

Comments
 (0)