Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

Friday Fun: Git Tip of the Day

Posted on June 10, 2016June 24, 2016

This year I've really taken to learning Git and how to incorporate it into my daily work routine. If nothing else this has been a great reminder about what it is like to learn something totally new and foreign. I've learned quite a bit, but am far from considering myself a master.  Git is a big topic so I'm always looking for new ways to learn and use it.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

I mentioned git the other day on Twitter and someone pointed me to the Git-Tips project on GitHub. The project is essentially a list of git tips stored in a JSON file. Very nice. Now, I don't want to read the tips and hope I'll remember them all so I came up with a plan to display a "Git Tip of the Day" every time I opened a PowerShell session, including the ISE. Here's how I did it.

First, I'm going to assume you have the latest version of Git installed. Next, go to the Git Tips project on GitHub. From here you two choices. You can download the current project as a zip file. Extract the folder to a location of your choice. The downside to this approach is that when new tips are added, you would need to re-download and extract. I recommend you create a local clone.

On the GitHub page click the Clone or Download button.

cloning git tips
Cloning Git Tips

Copy the URL to the clipboard. Next, open a PowerShell or CMD prompt. Navigate to the top level folder where you want to create the clone. In my case, I changed to C:\Scripts. Run this command:

git clone https://github.com/git-tips/tips.git

This will create a new directory called Tips which will be a Git clone. You can create the folder where ever you want. If you want to see all of the tips you can use a PowerShell expression like this:

Get-Content -path C:\scripts\tips\tips.json | 
ConvertFrom-Json | 
Foreach { $_ | Out-Gridview -Title "Git Tips" }
Git Tips
Git Tips

But I want to display a randomly selected tip every time I start PowerShell. I wrote this simple script:

Then in my PowerShell profile for current user all hosts I added this line.

C:\scripts\Show-GitTip.ps1

Now when I start PowerShell I am greeted with a tip.

git tip of the day
Git Tip of the Day

That's it! The only thing you might want to do is periodically check the status of the cloned repository and pull new changes as needed. You can actually pull anytime you want.

managing the repository
Managing the repository

The great thing about Git is that your local repository is completely separate. If you decide you no longer need it, simply delete the folder. It will have no effect anywhere else.

I'm excited to continue learning about Git and my tip of the day script has already taught me a few new things. I hope you find it useful as well.


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d