powerShell git 使用 以及循环本地目录脚本
- git 安装
- 配置git的环境变量----cmd :git --version
- 安装NuGet 管理器—Install-PackageProvider NuGet -Force
- 引入NuGet管理器—Import-PackageProvider NuGet -Force
- 克隆posh-git 工程------ git clone https://github.com/dahlbyk/posh-git
- 安装运行 posh----进入posh-git 目录 运行.\install.ps1
- 编写脚本
$sourcFolder = Get-Location
$folderList = Get-ChildItem -Name ccbscf-*
Foreach($folder in $folderList)
{
echo "---------------FETCH PORJECT NAME---------------$folder---------------"
cd $sourcFolder/$folder
git remote
git fetch --all
}
cd $sourcFolder