Having to constantly retype your SSH private key passphrase to use Git is annoying, and there are a number of articles out there about how to get around the issue.
Problem is, most of the recommendations on the Windows side assume you’re using Git Bash, so you’re only using the shell emulator for Git. They haven’t been updated for Ubuntu on Windows* where you are probably using Bash for lots of things, not just Git, and it would be just as annoying to have to enter your SSH private key passphrase every time you open Bash as it would be to have to enter your passphrase every time you use a Git command.
(That is dot space and then your file path and name. Dot space dot slash sshagent.sh would work as well if you’re currently in your home directory . ./sshagent.sh)
Now, you can start Bash normally, and it won’t bug you about your SSH passphrase at startup. If you do need to use Git, you can run your little script with . /sshagent.sh
It’ll ask for your passphrase, and then you won’t have to mess with it again.
And that is how you spend hours consolidating two commands into one. Happy coding!
* Ubuntu on Windows is probably the greatest decision Microsoft has made since Windows 7. If you aren’t using it, you should.