Productivity Tools

Tools written by an IT business manager, a passionate developer.

Manage Git repositories

The module allows managing multiple repositories at the same time. I am using it as a backup tool.

Every day I am scanning my repositories and check if any of them has some uncommitted changes. If yes, changes are pushed. If changes weren’t staged, a new AutoCommitBranch branch is created and data is pushed there.

The module also allows me to update all repositories from the given directory.

Check out the detailed description of the commands below.

Pull-GitRepository

Performs git pull for a given directory. Following command will

Pull-GitRepository D:\GitHub\ProductivityTools.ConnectionString\
PullGitRepository

Pull-GitRepositories

Iterates through the list of directories under the directory provided and invokes git pull for each repository.

Pull-GitRepositories D:\GitHub\
Pull-GitRepositories

Push-GitRepository

It pushes changes to the Git repository. If the current branch is ahead of the remote, it will push it, if changes are not committed it will create AutoCommit branch and push all changes to it.

Push-GitRepository
Push-GitRepository -Directory D:\GitHub\ProductivityTools.ConnectionString\
Push-GitRepository

Push-GitRepositories

It iterates through given directory and for each directory inside it will invoke Push-GitRepository cmdlet.

Push-GitRepositories D:\GitHub\

It will open GitHub directory and for each directory inside it will invoke Push-GitRepository

Push-GitRepositories

Get-AutoCommitRepository

Checks if git repository contains AutoCommitBranch branch.

Get-AutoCommitRepository D:\GitHub\ProductivityTools.Meetings\
Get-AutoCommitRepository

Get-AutoCommitRepositories

Iterates through all git repositories inside a provided directory and invoke Get-AutoCommitRepository for each.

Get-AutoCommitRepositories -Directory D:\GitHub\
Get-AutoCommitRepositories

Get-GitRepositoryStatus

Checks if the given repository has something to be committed.

Get-GitRepositoryStatus D:\GitHub\ProductivityTools.ConnectionString\
Get-GitRepositoryStatus

Get-GitRepositoriesStatus

Iterates through all git repositories inside provided directory and invoke Get-GitRepositoryStatus for each.

Get-GitRepositoriesStatus -Directory D:\GitHub\
Get-GitRepositoriesStatus