Skip to content

This PowerShell script will recursively loop through all folders in a path and tidy up old Git Branches etc.

License

Notifications You must be signed in to change notification settings

gbuktenica/Clean-Local-Git-Folder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clean Local Git Folder

License Copyright Glen Buktenica

Overview

This PowerShell script will recursively loop through all folders in a path and remove local Git Branches that have been removed from the remote.

Usage

Clean-LocalGitFolder.ps1

Finds sub directories of "$env:USERPROFILE\source" up to a depth of 2 subfolders and prunes Git branches if those directories have a .git directory and have been removed from the remote.

Clean-LocalGitFolder.ps1 -LocalGitFolder "C:\MyGit"

Finds sub directories of "C:\MyGit" up to a depth of 2 subfolders and prunes Git branches if those directories have a .git directory and have been removed from the remote.

Clean-LocalGitFolder.ps1 -LocalGitFolder "C:\MyGit" -Depth 1

Finds sub directories of "C:\MyGit" up to a depth of 1 subfolder and prunes Git branches if those directories have a .git directory and have been removed from the remote.

About

This PowerShell script will recursively loop through all folders in a path and tidy up old Git Branches etc.

Resources

License

Stars

Watchers

Forks

Packages

No packages published