在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Iristyle/Posh-GitHub开源软件地址:https://github.com/Iristyle/Posh-GitHub开源编程语言:PowerShell 100.0%开源软件介绍:Posh-GitHubUnofficial Powershell cmdlets that expose the GitHub API Early CodeThis is a super super early take on some rudimentary GitHub functionality. I will continue to improve this over time as need grows / time allows. There may be bugs or things I haven't thought of -- please report if that's the case! Compatibility
InstallationChocolateyOnce Chocolatey has been installed, simply use the cinst posh-github Chocolatey installation will import the module into your PowerShell profile. UpdatingChocolateyAfter installing with Chocolatey, simply use the cup posh-github Supported CommandsEnvironment VariablesCmdlets are set to use the following environment variables as defaults
Last Command OutputA Powershell object created from the incoming JSON is always stored
in the variable New-GitHubOAuthTokenUsed to create a new OAuth token for use with the GitHub using your
username/password in basic auth over HTTPS. The result is stashed in the
New-GitHubOAuthToken -UserName Bob -Password bobpassword New-GitHubOAuthToken -UserName Bob -Password bobpassword -NoEnvironmentVariable Get-GitHubOAuthTokensUsed to list all the authorizations you have provided to applications / tooling Get-GitHubOAuthTokens Bob bobspass Set-GitHubUserNameAdds the username to the current Powershell session and sets a global User environment variable Set-GitHubUserName Iristyle Set-GitHubOrganizationAdds the organization to the current Powershell session and sets a global User environment variable Set-GitHubOrganization EastPoint Get-GitHubRepositoriesList all your repositories - gives a fork indicator, a date for when the last update (push) occurred, how many open issues and size Get-GitHubRepositories Get-GitHubRepositories -Type owner -Sort pushed New-GitHubRepositoryCreates a new GitHub repository and clones it locally by default. By default creates a public repository for the user configured by
New-GitHubRepository MyNewRepository If you are a member of an organization and have set a New-GitHubRepository MyNewOrgRepo -ForOrganization -TeamId 1234 If you are a member of multiple organizations you may override the default configured organization New-GitHubRepository MyNewOrgRepo -Organization DifferentOrg -TeamId 1234 A fancier set of switches -- pretty self-explanatory. The complete Gitignore list here is at your disposal. New-GitHubRepository RepoName -Description 'A New Repo' `
-Homepage 'https://www.foo.com' -Private -NoIssues -NoWiki -NoDownloads `
-AutoInit -GitIgnoreTemplate 'CSharp' -NoClone New-GitHubForkForks a repository, clones it locally, then properly adds a remote named
Uses the environment variable New-GitHubFork Iristyle 'Posh-GitHub' Performs the same operation as above, instead forking to the default
organization specified by the New-GitHubFork Iristyle 'Posh-GitHub' -ForOrganization Performs the same operation as above, instead forking to a user specified
organization specified by the New-GitHubFork Iristyle 'Posh-GitHub' -Organization MySecondOrganization Forks the repository, without calling New-GitHubFork -Owner Iristyle -Repository 'Posh-GitHub' -NoClone Get-GitHubIssuesList issues against the repository for the current working directory, or can list issues against a specific repo and owner. Simply list issues for the current working directory repository. Checks first
for an If the current directory is not a repository, then lists all the issues assigned
to you, assuming the Get-GitHubIssues To get your issues regardless of whether or not the current directory is a Git repository. Get-GitHubIssues -ForUser Same as above, but finds up to the last 30 closed issues. Get-GitHubIssues -State closed All parameters possible when searching for user issues Get-GitHubIssues -ForUser -State open -Filter created -Sort comments `
-Direction asc -Labels 'ui','sql' -Since 8/31/2012 Must be ordered by Owner, Repo if not using switches on params Get-GitHubIssues EastPoint Burden Switch on params form Get-GitHubIssues -Owner EastPoint -Repository Burden Closed issues Get-GitHubIssues -Owner EastPoint -Repository Burden -State closed Supplying all parameters for a repository based issue search Get-GitHubIssues -Owner EastPoint -Repository Burden -State closed `
-Milestone '*' -Assignee 'none' -Creator 'Iristyle' -Mentioned 'Iristyle'
-Labels 'ui','sql' -Sort updated -Direction desc -Since 8/31/2012 New-GitHubPullRequestInitiates a new pull request to the If you follow the convention of setting a remote named upstream, and you create new branches for new work, then this cmdlet should work mostly automatically to find the appropriate owner and repo to send the pull request to, and it will base it on the origin username and current branch name. Supports a title and body. New-GitHubPullRequest -Title 'Fixed some stuff' -Body 'More detail' Support an issue id. New-GitHubPullRequest -Issue 5 Supports a branch other than master to send the pull to. New-GitHubPullRequest -Issue 10 -Base 'devel' If you don't have a remote set, then override the default sniffing behavior. New-GitHubPullRequest -Issue 10 -Owner EastPoint -Repository Burden If you're not on the current branch you want to send the pull for, override it. New-GitHubPullRequest -Title 'fixes' -Head 'myusername:somebranch' Note that GitHub generally requires that head be prefixed with Get-GitHubPullRequestsList pull requests against the repository for the current working directory, or can list pull requests against all forks from a user. Inside of a Git repository, this will look first for a remote named Inside of a non-Git directory, this will list pulls for all of your forks,
assuming you have set the Get-GitHubPullRequests When inside of a Git directory, the repo lookup behavior may be overridden
with the Get-GitHubPullRequests -ForUser Will list all open pull requests the 'Posh-GitHub' repository Get-GitHubPullRequests -Owner EastPoint -Repository 'Posh-GitHub' Lists all open public pull requests against the given users forks, overriding
the Get-GitHubPullRequests -User Iristyle Will list all closed pull requests against the 'Posh-GitHub' repository Get-GitHubPullRequests -Owner EastPoint -Repository 'Posh-Github' -State closed Get-GitHubTeamsThe default parameterless version will use the Get-GitHubTeams This will find all the teams for the EastPoint organization. You must have access to the given organization to list its teams. Get-GitHubTeams EastPoint Get-GitHubEventsWill list, in chronological order, the last 30 events that you have generated Get-GitHubEvents Will list the public events for another user Get-GitHubEvents -User Iristyle Backup-GitHubRepositoriesThis will clone every repository for the specified user or organization, and will additionally clone each fork, as determined by open pull requests. Does not backup issues or wiki (yet). The default parameterless version will use the Backup-GitHubRepositories This will find all the public repos for the github organization, and will clone each one locally Backup-GitHubRepositories -Organization github Additional Git helper commandsThese commands do not use GitHub service, but are common enough for inclusion. Clear-GitMergedBranchesWill remove any local branch cruft from branches that have been merged into the master branch. Clear-GitMergedBranches When pull requests have been merged, it's typical to delete the branch after accepting. Remotes may no longer have branch names for things that have been merged. This command removes remote branch names that no longer exist. Clear-GitMergedBranches -Remote RoadmapNone really.. just waiting to see what I might need. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论