gpt4 book ai didi

git - 在 Powershell 中为 Git 分支添加选项卡完成

转载 作者:IT王子 更新时间:2023-10-29 00:57:35 26 4
gpt4 key购买 nike

在 Git 存储库中时,是否可以将分支的制表符补全功能添加到 Powershell?例如:

PS> git checkout maTAB

会导致

PS> git checkout master

最佳答案

要做到这一点,PowerShell 的 git 提供程序需要存在。

快速搜索后,显然存在类似的东西,奇怪但恰本地命名为 posh-git:

http://github.com/dahlbyk/posh-git

A set of PowerShell scripts which provide Git/PowerShell integration

  • Prompt for Git repositories: The prompt within Git repositories can show the current branch and the state of files (additions, modifications,
    deletions) within.
  • Tab completion: Provides tab completion for common commands when using git. E.g. git ch<tab> --> git checkout

Usage

See profile.example.ps1 as to how you can integrate the tab completion and/or git prompt into your own profile. You can also choose whether advanced git commands are shown in the tab expansion or only simple/common commands. Default is simple.

关于git - 在 Powershell 中为 Git 分支添加选项卡完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3586722/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com