aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--docs/git.md99
-rw-r--r--docs/yubikey.md (renamed from docs/cheatsheet.md)111
2 files changed, 107 insertions, 103 deletions
diff --git a/docs/git.md b/docs/git.md
new file mode 100644
index 0000000..c6ae4ac
--- /dev/null
+++ b/docs/git.md
@@ -0,0 +1,99 @@
+# Git
+
+My personal cheat sheet of commands for various tools and workflows
+
+- [Git](#git)
+ - [Split out subfolder into new repository](#split-out-subfolder-into-new-repository)
+ - [(Optional) Migrate original subdir to submodule](#optional-migrate-original-subdir-to-submodule)
+
+## Split out subfolder into new repository
+
+*Be sure you are inside the original repo*
+
+```sh
+cd <orignal_repository>/<subdir-to-split>
+```
+
+Set local variables for use
+
+```sh
+username="$(git config user.username)"
+subdir="$(git rev-parse --show-prefix)"
+newrepo="$(basename $subdir)"
+oldrepo="$(git rev-parse --show-toplevel)"
+cd $oldrepo
+```
+
+Create a new branch containing only the sub-directory using `git subtree`
+
+```sh
+git subtree split -P $subdir -b $newrepo
+```
+
+Create a temp git repo and pull in the newly created branch
+
+```sh
+cd $(mktemp -d)
+
+git init && git pull $oldrepo $newrepo
+```
+
+Copy over the git artifacts from original repo's root directory
+
+```sh
+cp -rt ./ $oldrepo/.gitignore $oldrepo/.gitattributes $oldrepo/.vscode
+```
+
+Commit changes
+
+```sh
+git add -A && git commit -m "split out $newrepo into submodule"
+```
+
+Create a new remote repository using something like [gh](https://github.com/cli/cli)
+
+```sh
+gh repo create $username/$newrepo
+```
+
+(Optional) You can also just create the new remote repository manually and set the new local repository's remote with
+
+```sh
+git remote add origin https://github.com/$username/$newrepo
+```
+
+Push newly created repository to remote
+
+```sh
+git push -u origin master
+```
+
+### (Optional) Migrate original subdir to submodule
+
+Switch back into the original repository
+
+```sh
+cd $oldrepo
+```
+
+Remove the `subdir` from git and the filesystem
+
+```sh
+git rm -rf $subdir
+rm -rf $subdir
+```
+
+Add the newly created remote repository as a submodule at the `subdir`'s path
+
+```sh
+git submodule add git@github.com:$username/$newrepo $subdir
+git submodule update --init --recursive
+```
+
+Commit the changes to the original repository and push to remote
+
+```sh
+git commit -m "split out $newrepo into submodule"
+git push -u origin master
+```
+
diff --git a/docs/cheatsheet.md b/docs/yubikey.md
index 4ee0407..b926d83 100644
--- a/docs/cheatsheet.md
+++ b/docs/yubikey.md
@@ -1,119 +1,24 @@
-My personal cheat sheet of commands for various tools and workflows
+# WSL2 YubiKey Setup
-- [Git](#git)
- - [Split out subfolder into new repository](#split-out-subfolder-into-new-repository)
- - [(Optional) Migrate original subdir to submodule](#optional-migrate-original-subdir-to-submodule)
-- [WSL2 Yubikey Setup](#wsl2-yubikey-setup)
+- [WSL2 YubiKey Setup](#wsl2-yubikey-setup)
+ - [Intro](#Intro)
- [SSH Agent](#ssh-agent)
- [In Windows](#in-windows)
- [VS Code](#vs-code)
- [In WSL2](#in-wsl2)
-# Git
+## Intro
-## Split out subfolder into new repository
-
-*Be sure you are inside the original repo*
-
-```sh
-cd <orignal_repository>/<subdir-to-split>
-```
-
-Set local variables for use
-
-```sh
-username="$(git config user.username)"
-subdir="$(git rev-parse --show-prefix)"
-newrepo="$(basename $subdir)"
-oldrepo="$(git rev-parse --show-toplevel)"
-cd $oldrepo
-```
-
-Create a new branch containing only the sub-directory using `git subtree`
-
-```sh
-git subtree split -P $subdir -b $newrepo
-```
-
-Create a temp git repo and pull in the newly created branch
-
-```sh
-cd $(mktemp -d)
-
-git init && git pull $oldrepo $newrepo
-```
-
-Copy over the git artifacts from original repo's root directory
-
-```sh
-cp -rt ./ $oldrepo/.gitignore $oldrepo/.gitattributes $oldrepo/.vscode
-```
-
-Commit changes
-
-```sh
-git add -A && git commit -m "split out $newrepo into submodule"
-```
-
-Create a new remote repository using something like [gh](https://github.com/cli/cli)
-
-```sh
-gh repo create $username/$newrepo
-```
-
-(Optional) You can also just create the new remote repository manually and set the new local repository's remote with
-
-```sh
-git remote add origin https://github.com/$username/$newrepo
-```
-
-Push newly created repository to remote
-
-```sh
-git push -u origin master
-```
-
-### (Optional) Migrate original subdir to submodule
-
-Switch back into the original repository
-
-```sh
-cd $oldrepo
-```
-
-Remove the `subdir` from git and the filesystem
-
-```sh
-git rm -rf $subdir
-rm -rf $subdir
-```
-
-Add the newly created remote repository as a submodule at the `subdir`'s path
-
-```sh
-git submodule add git@github.com:$username/$newrepo $subdir
-git submodule update --init --recursive
-```
-
-Commit the changes to the original repository and push to remote
-
-```sh
-git commit -m "split out $newrepo into submodule"
-git push -u origin master
-```
-
-# WSL2 Yubikey Setup
-
-The following two sections are the result of a painstaking amount of google searches and github issues followed by troubleshooting, tears, and tea breaks. Well, more accurately, the 20% came from the aforementioned alliteration. The 80% came from the following two guides.
+The following two sections are the result of a painstaking amount of google searches and GitHub issues followed by troubleshooting, tears, and tea breaks. Well, more accurately, the 20% came from the aforementioned alliteration. The 80% came from the following two guides.
- [drduh/YubiKey-Guide](https://github.com/drduh/YubiKey-Guide)
- [The ultimate guide to Yubikey on WSL2](https://dev.to/dzerycz/series/11353)
-The former is a incredibly detailed guide to setting up GPG keys using YubiKey as a smartcard. The amount of information drduh has organized in that repository in immense, so I urge you to go star it if you find anything in this section helpful, as he deserves at least that much.
+The former is an incredibly detailed guide to setting up GPG keys using YubiKey as a smart card. The amount of information drduh has organized in that repository in immense, so I urge you to go star it if you find anything in this section helpful, as he deserves at least that much.
The second guide was used more as a reference/verification source for the first guide but none-the-less I found it to be helpful, so I figured I would include it here.
-While I went down this rock filled rabbit hole for the purpose of getting my Yubikey working (seamlessly) in WSL2, the majority of this should be helpful even if you don't use a security key, as it specificity deals with getting the respective agents/sockets communicating between WSL2 and Windows.
+While I went down this rock filled rabbit hole for the purpose of getting my YubiKey working (seamlessly) in WSL2, the majority of this should be helpful even if you don't use a security key, as its specificity deals with getting the respective agents/sockets communicating between WSL2 and Windows.
## SSH Agent
@@ -213,4 +118,4 @@ New-ItemProperty -Path $key.PSPath -Name "gpg-bridge" -Value "$cmdl"
The only setup needed for getting the YubiKey working in WSL2 is to source/copy-paste [gpg.sh](shell/gpg.sh) in your shell profile.
-Along with the initialization code, I wrote a small function the resets all the related agents/sockets. If you do not attempt to access the Yubikey while it is not inserted, in my experience, gpg works great has no issues once reinserting the Yubikey. It is only (inconsistently) when you try to access a Yubikey that you have removed that puts it in a failed state. \ No newline at end of file
+Along with the initialization code, I wrote a small function the resets all the related agents/sockets. If you do not attempt to access the YubiKey while it is not inserted, in my experience, GPG works great has no issues once reinserting the YubiKey. It is only (inconsistently) when you try to access a YubiKey that you have removed that puts it in a failed state. \ No newline at end of file