- Powershell Core (7+)
- git 2.41+
Microsoft has instructions to install PowerShell for macOS. Alternatively, if you already have the latest .NET Runtime installed, you can install PowerShell as a .NET Global tool.
dotnet tool install --global PowerShell
Note: if you have an older version installed, such as .NET 7, you can install an older version of PowerShell.
-
See the above prerequisites.
-
Clone this repository. If you are working on multiple projects and need specific versions of the tools, clone it once for each project (or use git workspaces).
-
In your terminal, navigate to the git directory in which you want to use the commands. Then run the
init.ps1
from this repository. For example, if this was cloned inC:\Users\Matt\Source\scalable-git-branching-tools
and you want to use them in "MyProject", run:C:\Users\Matt\Source\scalable-git-branching-tools\init.ps1
Relative paths work, too. To clone and run, you may use the following commands:
git clone https://github.com/PrincipleStudios/scalable-git-branching-tools.git ../scalable-git-branching-tools ../scalable-git-branching-tools/init.ps1
Install the latest version of Pester:
Install-Module Pester -Force
Import-Module Pester -PassThru
From the git-tools folder, run:
Invoke-Pester
There are also docker integration tests that actually run the git commands; run:
docker build .
Note that, due to the use of Import-Module
, PowerShell caches scripts in the local environment. This won't affect users when updating, since each git alias launches a new pwsh
scope. However, for developers, you can use the following command to pick up changes in any .psm1
files within this project:
./reset.ps1
If you want to test it locally, but don't have a git repository set up, you can use one of the samples via Docker! Run one of the following:
docker build . -t git-tools-demo -f Dockerfile.demo
docker build . -t git-tools-demo -f Dockerfile.demo --build-arg demo=local
docker build . -t git-tools-demo -f Dockerfile.demo --build-arg demo=remote-release
docker build . -t git-tools-demo -f Dockerfile.demo --build-arg demo=remote-without-config
docker build . -t git-tools-demo -f Dockerfile.demo --build-arg demo=remote
# build arg matches ./demos/demo-<arg>.ps1
Then take the resulting image SHA hash and run:
docker run --rm -ti git-tools-demo
This will give you a PowerShell prompt in the repos directory; cd local
and try out the commands!