git


Git: Delete Merged Local Branches That No Longer Exist with Powershell

Previously, I wrote about how to delete git branches that have been merged and no longer exist on the remote using git bash. Using git bash worked just fine for this. However, my normal shell is PowerShell and I want to stay in PowerShell.

In this post, we will look at how to use PowerShell instead to delete your local git branches that have been merged and no longer exist on the remote.

Read More


Switch Between Github Accounts on Windows

Recently, I had to create a Github account for work in addition to the one that I have for my personal repos. Not a big deal having two accounts but figuring out how to switch the account to use depending on the repository was difficult to figure out.

Luckily, the solution is really straight forward to implement. methods

Read More


Git - Remove Local Branches That Are Merged or No Longer Exist

After a while your list of local git branches can get a bit out of control especially if you doing all of your development on a branch, creating a pull request, merging it to main and then deleting the remote git branch when it is merged into main. Once the branch is deleted on the remote repository there is no need to keep it locally anymore.

Read More


Git: Clone Branch to New Repo without History

For my Angular workshop repository I wanted to clone the final branch without any history to a new repository so that I could try out some different technologies but I didn’t want to polute the workshop repository. Luckily, we can do this using the git clone command. Command Here is the basic command. Replace “Branch Name” with the name of your branch, “Git Repo” with the url to your Git repository, and “Folder Name” to the directory that you want to clone the branch into.

Read More


Sync your Git Fork to the Original Repo

Syncing your forked repository to the original repository is an important step before submitting any pull request to the original repository for the changes in your forked repository. Even if you are not going to submit a pull request to the original repository, there are times that you want the additional features and/or bug fixes that have been done since you forked the original repository. You could do a pull request but this adds an additional commit into your forked repository instead of making your forked repository match the original repository.

Read More


Sync your Git Fork to the Original Repo

Syncing your forked repository to the original repository is an important step before submitting any pull request to the original repository for the changes in your forked repository. Even if you are not going to submit a pull request to the original repository, there are times that you want the additional features and/or bug fixes that have been done since you forked the original repository. You could do a pull request but this adds an additional commit into your forked repository instead of making your forked repository match the original repository.

Read More


Visual Studio 2015 - External Web Tools

I ran into an issue with an npm package mis-behaving in Visual Studio 2015 but working just fine from the command line. After scratching my head for awhile trying to figure out what was going on, I discovered that Visual Studio was pointing to its own version of npm and node and not that ones that were available in my path that the command line was using. Visual Studio 2015 ships with:

Read More


Add Git Branch Name to Bash Prompt

When I am working on a git repository and using the git command line, one of the things that I often end up checking it which git branch I am on and if there are any pending changes. How awesome would it be if the bash shell prompt, told you the branch name if the directory is part of a git repository and if there are any changes. Well, thankfully someone has done this work already and with a little bit of configuration on your part, you can implement the changes.

Read More


Git Command Notes

I am finally making myself learn the git command line instead of just using a UI so that I can actually understand what git is really doing. Plus I have started playing a lot with the IonicBox and running a Ubuntu vagrant controlled VM for this blog and both of those are just linux shell command prompt only machines. Below are my notes on various commands so that I can stop having to Google each time I forgot one of them.

Read More