{"id":14064118,"url":"https://github.com/StartAutomating/ugit","last_synced_at":"2025-07-29T17:32:11.701Z","repository":{"id":38274744,"uuid":"471524111","full_name":"StartAutomating/ugit","owner":"StartAutomating","description":"Updated Git: A powerful PowerShell wrapper for git that lets you extend git, automate multiple repos, and output git as objects.","archived":false,"fork":false,"pushed_at":"2024-04-17T01:56:04.000Z","size":1237,"stargazers_count":66,"open_issues_count":23,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-23T00:31:15.768Z","etag":null,"topics":["git","powershell"],"latest_commit_sha":null,"homepage":"https://ugit.start-automating.com","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StartAutomating.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["StartAutomating"]}},"created_at":"2022-03-18T21:39:31.000Z","updated_at":"2024-08-13T07:06:13.460Z","dependencies_parsed_at":"2024-02-28T19:48:13.965Z","dependency_job_id":"936321e8-410d-4dd3-ac78-5e5635e856b0","html_url":"https://github.com/StartAutomating/ugit","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2Fugit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2Fugit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2Fugit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2Fugit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StartAutomating","download_url":"https://codeload.github.com/StartAutomating/ugit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228032924,"owners_count":17858917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","powershell"],"created_at":"2024-08-13T07:03:41.252Z","updated_at":"2024-12-04T02:31:12.202Z","avatar_url":"https://github.com/StartAutomating.png","language":"PowerShell","readme":"\u003cdiv align='center'\u003e\n\u003cimg src='assets/ugit.svg' alt='ugit' /\u003e\n\u003ca href='https://www.powershellgallery.com/packages/ugit/'\u003e\n\u003cimg src='https://img.shields.io/powershellgallery/dt/ugit' /\u003e\n\u003c/a\u003e\n\u003cbr/\u003e\n\u003ca href='https://github.com/sponsors/StartAutomating'\u003e❤️\u003c/a\u003e\n\u003ca href='https://github.com/StartAutomating/ugit/stargazers'\u003e⭐\u003c/a\u003e\n\u003c/div\u003e\n\nugit (Updated Git) is a powerful PowerShell module for git that lets you: output git as objects, automate multiple repos, and extend git.\n\n## What is ugit?\n\nugit is a PowerShell module that gives you an updated git.  You can use the object pipeline to pipe folders or files into git.  \nIf you're using one of a number of supported commands, ugit will return your git output as objects.\nThis enables _a lot_ of interesting scenarios, giving you and updated way to work with git.\n\n## Getting started\n\n~~~PowerShell\n# Install ugit from the PowerShell Gallery\nInstall-Module ugit -Scope CurrentUser\n# Then import it.\nImport-Module ugit -Force -PassThru\n\n# Once you've imported ugit, just run git commands normally.\n# If ugit has an extension for the command, it will output as an object.\n# These objects can be formatted by PowerShell\ngit log -n 5 \n\n# To get a sense of what you can do, pipe a given git command into Get-Member.\ngit log -n 5 |\n  Get-Member\n~~~\n\n## How ugit works:\n\nugit only has a few commands:\n\n### [Use-Git](docs/Use-Git.md)\n\nAfter you've imported ugit, Use-Git is what will be called when you run \"git\".\n\nThis happens because Use-Git is aliased to \"git\", and aliases are resolved first in PowerShell.\n\nUse-Git assumes all positional parameters are arguments to Git, and passes them on directly.\n\nThis works in almost every scenario, except with some single character git options.  You can pass these in quotes.\n\nWhen Use-Git outputs, it sets $global:LastGitOutput and then pipes to Out-Git.\n\n### [Out-Git](docs/Out-Git.md)\n\nOut-Git will attempt to take git output and return it as a useful object.\n\nThis object can then be extended and formatted by PowerShell's Extended Type System.\n\nOut-Git accomplishes this with several extensions.  You can list extensions with Get-UGitExtension:\n\n### Get-UGitExtension\n\nGet-UGitExtension enables any file beneath ugit (or a module that tags ugit) named *.ugit.extension.ps1 to be treated as an extension.\n\nIn ugit, extensions signal that they apply to a given git command by adding a ```[ValidatePattern]``` attribute to the command.\n\nIf this pattern matches the given git command, the extension will run.\n\nGet-UGitExtension is built using [Piecemeal](https://github.com/StartAutomating/Piecemeal)\n\n## ugit examples\n\nugit comes packed with many examples.\nYou might want to try giving some of these a try.\n\n### Git.Blame Example 1\n\n\n~~~PowerShell\n    git blame ugit.psd1\n~~~\n\n### Git.Branch.Input Example 1\n\n\n~~~PowerShell\n    git branch -Remote\n~~~\n\n### Git.Branch Example 1\n\n\n~~~PowerShell\n    git branch  # Get a list of branches\n~~~\n\n### Git.Branch Example 2\n\n\n~~~PowerShell\n    git branch |                                          # Get all branches\n        Where-Object -Not IsCurrentBranch |               # where it is not the current branch\n        Where-Object BranchName -NotIn 'main', 'master' | # and the name is not either main or master\n        git branch -d                                     # then attempt to delete the branch.\n~~~\n\n### Git.Checkout Example 1\n\n\n~~~PowerShell\n    git checkout -b CreateNewBranch\n~~~\n\n### Git.Checkout Example 2\n\n\n~~~PowerShell\n    git checkout main\n~~~\n\n### Git.Clone.Input Example 1\n\n\n~~~PowerShell\n    git clone https://github.com/MDN/content.git # This is a big repo.  Progress bars will be very welcome.\n~~~\n\n### Git.Clone.Input Example 2\n\n\n~~~PowerShell\n    # If we don't check things out, cloning is faster.\n    git clone https://github.com/PowerShell/PowerShell -NoCheckout \n    # (of course, that's because we're not copying files, just history)\n~~~\n\n### Git.Clone.Input Example 3\n\n\n~~~PowerShell\n    # We can also clone more quickly by only picking a certain number of commits\n    git clone https://github.com/Microsoft/vscode.git -Depth 1\n    # (of course, this will make the history lie to you,\n    # by saying everything was changed whenever anything was changed)\n~~~\n\n### Git.Clone Example 1\n\n\n~~~PowerShell\n    git clone https://github.com/StartAutomating/ugit.git\n~~~\n\n### Git.Clone Example 2\n\n\n~~~PowerShell\n    # Clone a large repo.\n    # When --progress is provided, Write-Progress will be called.\n    git clone https://github.com/Azure/azure-quickstart-templates --progress\n~~~\n\n### Git.Commit.Input Example 1\n\n\n~~~PowerShell\n    git commit -Title \"Fixing Something\"\n~~~\n\n### Git.Commit.Input Example 2\n\n\n~~~PowerShell\n    git commit -Title \"Changing Stuff\" -Trailers @{\"Co-Authored-By\"=\"SOMEONE ELSE \u003cSomeone@Else.com\u003e\"}\n~~~\n\n### Git.Commit Example 1\n\n\n~~~PowerShell\n    git commit -m \"Updating #123\"\n~~~\n\n### Git.Commit Example 2\n\n\n~~~PowerShell\n    $committedMessage = git commit -m \"Committting Stuff\" # Whoops, this commit had a typo\n    $commitMessage.Amend(\"Committing stuff\") # that's better\n~~~\n\n### Git.Config.List Example 1\n\n\n~~~PowerShell\n    git config --list\n~~~\n\n### Git.Config.List Example 2\n\n\n~~~PowerShell\n    git config --global --list\n~~~\n\n### Git.Config.List Example 3\n\n\n~~~PowerShell\n    git config --list --local\n~~~\n\n### Git.Config.List Example 4\n\n\n~~~PowerShell\n    git config --list --show-origin\n~~~\n\n### Git.FileName Example 1\n\n\n~~~PowerShell\n    git diff --name-only\n~~~\n\n### Git.FileOutput Example 1\n\n\n~~~PowerShell\n    git archive -o My.zip\n~~~\n\n### Git.Format.Json Example 1\n\n\n~~~PowerShell\n    git branch --format \"{'ref':'%(refname:short)','parent':'%(parent)'}\"\n~~~\n\n### Git.Format.Simple Example 1\n\n\n~~~PowerShell\n    git branch --format \"%(refname:short)|%(objectname)|%(parent)|%(committerdate:iso8601)|%(objecttype)\"\n~~~\n\n### Git.Grep Example 1\n\n\n~~~PowerShell\n    git grep '-i' example # look for all examples in the repository\n~~~\n\n### Git.Help.All Example 1\n\n\n~~~PowerShell\n    git help -a\n~~~\n\n### Git.Help.All Example 2\n\n\n~~~PowerShell\n    git help --all\n~~~\n\n### Git.Init Example 1\n\n\n~~~PowerShell\n    git init # Initialize the current directory as a repository\n~~~\n\n### Git.Log.Input Example 1\n\n\n~~~PowerShell\n    git log -CurrentBranch\n~~~\n\n### Git.Log Example 1\n\n\n~~~PowerShell\n    # Get all logs\n    git log |\n        # until the first merged pull request\n        Where-Object -Not Merged\n~~~\n\n### Git.Log Example 2\n\n\n~~~PowerShell\n    # Get a single log entry\n    git log -n 1 |\n        # and see what the log object can do.\n        Get-Member\n~~~\n\n### Git.Log Example 3\n\n\n~~~PowerShell\n    # Get all logs\n    git log |\n        # Group them by the author\n        Group-Object GitUserEmail -NoElement |\n        # sort them by count\n        Sort-Object Count -Descending\n~~~\n\n### Git.Log Example 4\n\n\n~~~PowerShell\n    # Get all logs\n    git log |\n        # Group them by day of week\n        Group-Object { $_.CommitDate.DayOfWeek } -NoElement\n~~~\n\n### Git.Log Example 5\n\n\n~~~PowerShell\n    # Get all logs\n    git log |\n        # where there is a pull request number\n        Where-Object PullRequestNumber |\n        # pick out the PullRequestNumber and CommitDate\n        Select PullRequestNumber, CommitDate\n~~~\n\n### Git.Log Example 6\n\n\n~~~PowerShell\n    git log --merges\n~~~\n\n### Git.Mv Example 1\n\n\n~~~PowerShell\n    git mv .\\OldName.txt .\\NewName.txt\n~~~\n\n### Git.Mv Example 2\n\n\n~~~PowerShell\n    git mv .\\OldName.txt .\\NewName.txt --verbose\n~~~\n\n### Git.Pull Example 1\n\n\n~~~PowerShell\n    git pull\n~~~\n\n### Git.Push Example 1\n\n\n~~~PowerShell\n    git push\n~~~\n\n### Git.RefLog Example 1\n\n\n~~~PowerShell\n    git reflog\n~~~\n\n### Git.Remote Example 1\n\n\n~~~PowerShell\n    git remote\n~~~\n\n### Git.Remote Example 2\n\n\n~~~PowerShell\n    git remote | git remote get-url\n~~~\n\n### Git.Remote Example 3\n\n\n~~~PowerShell\n    git remote | git remote show\n~~~\n\n### Git.Rm Example 1\n\n\n~~~PowerShell\n    git rm .\\FileIDontCareAbout.txt\n~~~\n\n### Git.Shortlog Example 1\n\n\n~~~PowerShell\n    git shortlog  # Get a shortlog\n~~~\n\n### Git.Shortlog Example 2\n\n\n~~~PowerShell\n    git shortlog --email # Get a shortlog with email information\n~~~\n\n### Git.Shortlog Example 3\n\n\n~~~PowerShell\n    git shortlog --summary # Get a shortlog summary\n~~~\n\n### Git.Shortlog Example 4\n\n\n~~~PowerShell\n    git shortlog --sumary --email # Get a shortlog summary, with email.\n~~~\n\n### Git.Sparse.Checkout.input Example 1\n\n\n~~~PowerShell\n    git sparse-checkout -FileFilters *.ps1,*.psm1\n~~~\n\n### Git.Stash Example 1\n\n\n~~~PowerShell\n    git stash list\n~~~\n\n### Git.Status Example 1\n\n\n~~~PowerShell\n    git status\n~~~\n\n### Git.Status Example 2\n\n\n~~~PowerShell\n    git status | Select-Object -ExpandProperty Untracked\n~~~\n\n### Git.SubModule.Status Example 1\n\n\n~~~PowerShell\n    git submodule\n~~~\n\n## Out-Git Extensions\n\n### Git Commands\n\nMost extensions handle output from a single git command.\n\n\n* [Git Blame](docs/Git.Blame-Extension.md)\n\n \n* [Git Branch](docs/Git.Branch-Extension.md)\n\n \n* [Git Checkout](docs/Git.Checkout-Extension.md)\n\n \n* [Git Clone](docs/Git.Clone-Extension.md)\n\n \n* [Git Commit](docs/Git.Commit-Extension.md)\n\n \n* [Git Config List](docs/Git.Config.List-Extension.md)\n\n \n* [Git Diff](docs/Git.Diff-Extension.md)\n\n \n* [Git FileName](docs/Git.FileName-Extension.md)\n\n \n* [Git Format Json](docs/Git.Format.Json-Extension.md)\n\n \n* [Git Format Simple](docs/Git.Format.Simple-Extension.md)\n\n \n* [Git Grep](docs/Git.Grep-Extension.md)\n\n \n* [Git Help All](docs/Git.Help.All-Extension.md)\n\n \n* [Git Init](docs/Git.Init-Extension.md)\n\n \n* [Git Log](docs/Git.Log-Extension.md)\n\n \n* [Git Mv](docs/Git.Mv-Extension.md)\n\n \n* [Git Pull](docs/Git.Pull-Extension.md)\n\n \n* [Git Push](docs/Git.Push-Extension.md)\n\n \n* [Git RefLog](docs/Git.RefLog-Extension.md)\n\n \n* [Git Remote](docs/Git.Remote-Extension.md)\n\n \n* [Git Rm](docs/Git.Rm-Extension.md)\n\n \n* [Git Shortlog](docs/Git.Shortlog-Extension.md)\n\n \n* [Git Stash](docs/Git.Stash-Extension.md)\n\n \n* [Git Status](docs/Git.Status-Extension.md)\n\n \n* [Git SubModule Status](docs/Git.SubModule.Status-Extension.md)\n\n\n\n### Additional Output Extensions\n\nA few extensions handle output from any number of git commands, depending on the arguments.\n\n* Git.FileName\n\nThis applies to any git command that uses --name-only.\nIt will attempt to return the name as a file, or as an object containing the name.\n\n* Git.FileOutput\n\nThis applies to an git command that uses the -o flag.\nIt will attempt to locate any output specified by -o and return it as a file or directory.\n\n## Use-Git Extensions\n\nugit also allows you to extend the input for git.\n\n\n* [Git Blame Input](docs/Git.Blame.Input-Extension.md)\n\n \n* [Git Branch Input](docs/Git.Branch.Input-Extension.md)\n\n \n* [Git Checkout Input](docs/Git.Checkout.Input-Extension.md)\n\n \n* [Git Clone Input](docs/Git.Clone.Input-Extension.md)\n\n \n* [Git Commit Input](docs/Git.Commit.Input-Extension.md)\n\n \n* [Git Log Input](docs/Git.Log.Input-Extension.md)\n\n \n* [Git Sparse Checkout input](docs/Git.Sparse.Checkout.input-Extension.md)\n\n\n\n## What uses ugit?\n\nugit is part of the core of [GitLogger](https://gitlogger.com/).\n\nGitLogger uses ugit to turn logs into objects and then provides standardized metrics and a way to query your logs.\n\n","funding_links":["https://github.com/sponsors/StartAutomating","https://github.com/sponsors/StartAutomating'"],"categories":["PowerShell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStartAutomating%2Fugit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStartAutomating%2Fugit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStartAutomating%2Fugit/lists"}