Using GIT_SSH_COMMAND in Git for Windows

You don’t have to set an environment variable anymore in Windows. With git 2.10+ (Q3 2016), you also have the possibility to set a config for GIT_SSH_COMMAND, which is easier than an environment variable (and can be set globally, or locally for a specific repo) See commit 3c8ede3 (26 Jun 2016) by Nguyễn Thái Ngọc … Read more

Various ways to remove local Git changes

It all depends on exactly what you are trying to undo/revert. Start out by reading the post in Ube’s link. But to attempt an answer: Hard reset git reset –hard [HEAD] completely remove all staged and unstaged changes to tracked files. I find myself often using hard resetting, when I’m like “just undo everything like … Read more

How to iterate through all git branches using bash script

You should not use git branch when writing scripts. Git provides a “plumbing” interface that is explicitly designed for use in scripting (many current and historical implementations of normal Git commands (add, checkout, merge, etc.) use this same interface). The plumbing command you want is git for-each-ref: git for-each-ref –shell \ –format=”git log –oneline %(refname) … Read more

VSCode is suddenly defaulting to powershell for integrated terminal and tasks

Update: Version v1.60.0 had a bug. Upgrade to v1.60.1 or higher for a fix. The bug manifested in the following symptoms: The Open in Integrated Terminal shortcut-menu command in the Explorer pane’s shortcut always uses the built-in default shell (PowerShell on Windows), ignoring the configured one. The same goes for running tasks (with or without … Read more