Installing WSL
Simply run the command wsl --install
and bam 💥 you have
WSL installed along with the Ubuntu distro.
Once the installation has been completed you'll be prompted to create
a user account and password.
This has no effect on any of your Windows things.
This created user account will have sudo
privileges so in
short it's an admin account... You can do anything with it if you use
that sudo
keyword.
Installing Git on WSL only
- Run the command
sudo apt-get install git
-
Setup your git config file by running the commands:
git config --global user.name "Theo"
-
git config --global user.email "theeoh@proton.me"
git config --global init.defaultBranch main
-
Install
Git Credential Manager
for Windows
-
Still in Windows open an administrator command prompt and run
SETX WSLENV %WSLENV%:GIT_EXEC_PATH/wp
to update theWSLENV
environment variable with some value Git requires
-
Still in Windows open an administrator command prompt and run
-
Run
git config --global credential.helper "/mnt/c/Program\ Files\ \(x86\)/Git\ Credential\ Manager/git-credential-manager.exe"
to set GCM as the Git credential helper -
Run
ssh-keygen -t ed25519 -C "theeoh@proton.me"
to create an SSH key. There will be some setup afterwards but just enter through all this and leave as defaults -
For sanity run the following 2 commands:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
-
Finally add the SSH key to your
SSH keys
in your GitHub account. To easily get your SSH key run
cd ~/.ssh
andcat id_ed25519.pub
then simply copy and paste into GitHub -
You can test your SSH setup's success by running
ssh -T git@github.com
... At first you might see a warning which asks you yes/no, just say yes and press enter then run the command again and if you see something likeHi theeoh-92! You've successfully authenticated, but GitHub does not provide shell access
You've done it correctly
From what I can remember I think that is the last of the Git stuff. From here on out you should be good to go with version control and pushing to GitHub etc...
VS Code on Windows Setup
Simply install the WSL extension inside VS Code and you good 🍻
Installing Node.js
I personally installed Node.js through NVM (Node Version Manager) since it makes it real easy to swap between different versions.
-
Install cURL by running the command
sudo apt-get install curl
. It is a tool used to download content from the internet using your terminal. -
Install nvm by running
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
. You can test it installed successfully by running the commandcommand -v nvm
and it should return 'nvm'. -
Install the stable LTS Node.js version by running the command
nvm install --lts
and both the latest versions of Node and NPM will install onto your WSL instance.
Documentation
- Installing WSL
- WSL-based Git related documentation:
- Installing NVM