New TIL tag and posts
Categories:
learnings
For a while at Chocolatey, we have had a Slack channel for things we learned. For almost as long I have been meaning to add a post about the things I learned to my blog. Recently, Julia Evans shared about her creation of a small “TIL” section on her site.
With that in mind, I have created a “TIL” tag on my blog, as well as redirecting https://coryknox.dev/til to the listing page for the tag.
Automatically setup remote tracking branch
Categories:
learnings
I learned this on CSharpFritz’s stream: git config --global --add --bool push.autoSetupRemote true. This allows you to be able to just do git push and it’ll automatically setup a remote tracking branch on your default remote.
Prevent force pushing even when remote is fetched automatically
Categories:
learnings
Today I learned from Scott Chacon about the --force-if-includes on git push. When used alongside --force-with-lease will negate the troubles potentially caused by applications that periodically git fetch for you. Basically it will prevent you from pushing if you’re pushing to a remote that has a commit that is not a common ancestor of what you’re pushing I think… If my testing is correct, then it’ll act like --force-with-lease when the remote has not been fetched down, but in the scenario where it has actually been fetched down.
Stash untracked changes in a way that git stash reports them
Categories:
learnings
I’ve learned that you can do git stash -u to stash untracked files as well as tracked files… But nothing will show you those files in the stash by default… Instead, if you do git add <untracked files> and then git stash, they are magically tracked files even if they’re not actually committed to the repository.
Run PowerShell no matter what
Categories:
learnings
VS Code is pretty amazing. Having the ability to edit virtually all of your files, and launch debugging sessions of them. But what if you have a codebase that has a .vscode/launch.json file and want to debug a PowerShell script?
Unfortunately, by default, F5 will only debug PowerShell if there are no debugger configurations. This means that pressing F5 will attempt to run the configured debugger for your workspace regardless of if you’re in a PowerShell file.
Preventing Updates on Vagrant Boxes
Categories:
General Computering
Picture the scenario: You have a Vagrant box that you’ve set up for testing purposes. It’s a Windows Server system, so you don’t worry about disabling Windows Updates. Then you reboot the VM to find that Windows has decided to install updates, and so you must wait for it to do it’s thing. But, what do you do? How can you prevent this? WSUS! But alas, what if you need to install something that is a Windows Update?