<commit_before>param([string]$buildFolder, [string]$docSource, [string]$repoUrl, [string]$email, [string]$username)

git config --global user.email $email
git config --global user.name $username
git config --global push.default matching

$workingDir = "$($buildFolder)\..\gh-pages"

Push-Location

if (Test-Path("$($workingDir)")) {
    Remove-Item "$($workingDir)" -Recurse -Force
}
mkdir $workingDir

git clone --quiet --branch=gh-pages "$($repoUrl)" "$($workingDir)"
cd $($workingDir)
git status

Get-ChildItem -Attributes !r | Remove-Item -Recurse -Force
Copy-Item -Path "$($buildFolder)\$($docSource)\**" -Destination $pwd.Path -Recurse
git status

$thereAreChanges = git status | select-string -pattern "Changes not staged for commit:","Untracked files:" -simplematch
if ($thereAreChanges -ne $null) { 
    Write-Host "Committing changes to docs..."
    git add --all
    git status
    git commit -m "CI build"
    git status
    git push --quiet
    Write-Host "Changes pushed succesfully" -ForegroundColor Green
}
else { 
    Write-Host "No changes to documentation to commit" -ForegroundColor Blue
}
Pop-Location<commit_msg>Improve pushDocs.ps1 - make git environment more predictable - use variable for gh-pages branch<commit_after>param([string]$buildFolder, [string]$docSource, [string]$repoUrl, [string]$email, [string]$username)

git config --global user.email $email
git config --global user.name $username
git config --global push.default simple
git config --global core.autocrlf true
git config --global core.safecrlf false

$workingDir = "$($buildFolder)\..\gh-pages"
$workingBranch = "gh-pages"

Push-Location

if (Test-Path("$($workingDir)")) {
    Remove-Item "$($workingDir)" -Recurse -Force
}
mkdir $workingDir

git clone --quiet --branch=$workingBranch "$($repoUrl)" "$($workingDir)"
cd $($workingDir)
git status

Get-ChildItem -Attributes !r | Remove-Item -Recurse -Force
Copy-Item -Path "$($buildFolder)\$($docSource)\**" -Destination $pwd.Path -Recurse
git status

$thereAreChanges = git status | select-string -pattern "Changes not staged for commit:","Untracked files:" -simplematch
if ($thereAreChanges -ne $null) { 
    Write-Host "Committing changes to docs..."
    git add --all
    git status
    git commit -m "CI build"
    git status
    git push
    Write-Host "Changes pushed succesfully" -ForegroundColor Green
}
else { 
    Write-Host "No changes to documentation to commit" -ForegroundColor Blue
}
Pop-Location
{'fraction_non_alphanumeric': 0.13982878108438646, 'fraction_numerical': 0.00040766408479412964, 'mean_word_length': 4.266094420600858, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7606704', 'n_tokens_mistral': 754, 'n_tokens_neox': 730, 'n_words': 237}