Introduction

You know you have been using git too long when you start typing git before every command in the command prompt. Typing git before every command is also 4 characters to many. I don’t even see why I should do that in the Git bash, doesn’t it know why I’m there. It’s boring and I have better things to do with my time. SO it’s time for a solution.

Powerconsole

I told you how to install powerconsole in a previous post. But you can also make your own function to use in powerconsole.

Here is where you can find the Powerconsoleuserprofile or at least that is where you are supposed to find it.

If you try the notepad command and get this.

you better get your explorer open and create the file.

after that is done we can add these commands to it.

Function solutionworkingdirectory()
{
  split-path -parent $dte.Solution.FileName | cd
}

Function branch()
{
  solutionworkingdirectory
  git branch
}```
after a restart of Visual Studio. I can now do this. 

<div class="image_block">
  <a href="/wp-content/uploads/users/chrissie1/powerconsole/powerconsole9.png?mtime=1298716073"><img alt="" src="/wp-content/uploads/users/chrissie1/powerconsole/powerconsole9.png?mtime=1298716073" width="298" height="91" /></a>
</div>

> <span class="MT_red">Big warning.<br /> If you have any syntax error anywhere in that ps1 file than the console will just ignore all functions in that file. Not just one ALL of them. I know I tried.</span>

After that I added 2 more functions to it.

Function branch($branch) { solutionworkingdirectory git branch $branch }

Function commit($message) { solutionworkingdirectory git add . git commit -a -m “$message” }``` With this as the result.

I have just save myself a gazilion number of keystrokes. I hope I saved you some too.

Conclusion

Powerconsole can make you life easier. Now I just need to automate the checkout routine.