posh-git

PowerShell美化

人走茶凉 提交于 2021-02-16 03:45:55
转载自 Powershell 美化 ——oh-my-posh ,作者 Zvonimir 。 PowerShell默认的主题太丑了,用过 OhMyZsh 之后是无法忍受这种丑陋的,幸好PowerShell有对应的OhMyPosh来解决这个问题。 更改脚本执行策略 如果你没有打开运行远程签名的脚本文件则会提示你输入下面的指令: Set-ExecutionPolicy RemoteSigned -scope CurrentUser 安装 scoop scoop 是 Windows 中超级好用的一个包管理器,许多软件可以通过这个包管理器直接傻瓜式安装,连环境变量也会自动配置好。可以类比 Linux 中的 yum 或者 apt,用习惯了会爱不释手的,非常推荐。 iex (new-object net.webclient).downloadstring('https://get.scoop.sh') 安装需要的软件 安装 concfg lukesampson/concfg 可以用来导入和导出 Windows 控制台的设置。 scoop install concfg 如果需要卸载可以输入 scoop uninstall concfg。 安装 git scoop install git 此时,git 的环境变量是设置在当前用户下的。如果需要设置在系统下,可以通过以下语句安装。需要使用 sudo

是时候扔掉cmder, 换上Windows Terminal

∥☆過路亽.° 提交于 2020-10-14 13:36:15
作为一个Windows的长期用户,一直没有给款好用的终端,知道遇到了 cmder,它拯救一个习惯用Windows敲shell命令的人。 不用跟我安利macOS真香!公司上班一直用macOS,一方面确实更加习惯windows下面学习, 另一方面是上课需要Windows QQ共享桌面。 windows Terminal 1.0发布,那么是时候和 cmder 说再见了。 不过需要做一些配置和美化。 美化主题 安装posh-git和oh-my-posh > Install-Module posh-git -Scope CurrentUser > Install-Module oh-my-posh -Scope CurrentUser 启用默认设置 > Set-Prompt 设置主题: > Set-Theme Sorin oh-my-posh 支持十几种主题: > Set-Theme 位于命令管道位置 1 的 cmdlet Set-Theme 请为以下参数提供值: name: ? 警告: Theme ? not found. Available themes are: Name Type Location ---- ---- -------- Agnoster Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my

从命令行向'git commit -m'添加换行符

删除回忆录丶 提交于 2019-12-28 19:08:00
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我从命令行使用Git,并尝试在提交消息中添加换行符(使用 git commit -m "" ),而不进入Vim。 这可能吗? #1楼 在Git提交中添加换行符 请尝试以下操作以创建多行提交消息: git commit -m "Demonstrate multi-line commit message in Powershell" -m "Add a title to your commit after -m enclosed in quotes, then add the body of your comment after a second -m. Press ENTER before closing the quotes to add a line break. Repeat as needed. Then close the quotes and hit ENTER twice to apply the commit." 然后验证你做了什么: git log -1 你应该得到这样的东西: 截图来自我使用PowerShell和Poshgit设置的示例。 #2楼 我希望这不会过于远离发布的问题,而是 设置默认编辑器 然后使用 git commit -e 可能会更舒服。 #3楼 就个人而言

posh-git doesn't show branch in package manager console

柔情痞子 提交于 2019-12-23 17:29:13
问题 I installed posh-git for Windows PowerShell and it works great in the shell. However, it is supposed to work in the package manager console as well. It does work but it doesn't show the current branch like the normal powershell window does. I followed this tutorial and everything went fine except for my package manager console doesn't look like his with the branch name. All you can see is PM> in the VS 2012 package manager console. But it works fine in the powershell. 回答1: Nuget has a

git -add doesn't work with wildcards

我与影子孤独终老i 提交于 2019-12-11 05:11:47
问题 I'm trying to add (edit: THE DELETE operation) of these files with the text "generated" in it, and it doesn't work. I'm using PowerShell. # deleted: Apica.WebPerformance.Web.Controllers/SharedController.generated.cs # deleted: Apica.WebPerformance.Web.Controllers/SidebarController.generated.cs # deleted: Apica.WebPerformance.Web.Controllers/SubscriptionController.generated.cs # deleted: Apica.WebPerformance.Web.Controllers/ToolsController.generated.cs # deleted: Apica.WebPerformance.Web

Don't colorize the refs with git log --pretty when --no-color is specified

浪尽此生 提交于 2019-12-07 21:56:34
问题 I'm working with Git, using Windows 7, PowerShell, and Posh-Git. I have the following alias setup: ls = log --pretty=tformat:"%C(yellow)%h\\ %C(green)[%ad]%C(cyan)\\ <%cn>\\ %C(reset)%s%C(auto)%d" The problem was that when I pipe the output to clip.exe to copy it to the clipboard, it also copies some characters for the colors. A little reading and I found you could add "auto," so that it would use the default colors if the --no-color option is specified. So now I have: ls = log --pretty

How to update posh-git

南楼画角 提交于 2019-12-06 23:42:59
问题 I have an old version of posh-git that I want to update (while trying to solve slow powershell start ups) I've pulls latest from the repo and when I am trying to do .\install.ps1 I get It seems posh-git is already installed... How do I update posh-git? 回答1: All it does is look if the script is being sourced in your profile: $profileLine = ". '$installDir\profile.example.ps1'" if(Select-String -Path $PROFILE -Pattern $profileLine -Quiet -SimpleMatch) { Write-Host "It seems posh-git is already

Don't colorize the refs with git log --pretty when --no-color is specified

一个人想着一个人 提交于 2019-12-06 06:03:06
I'm working with Git, using Windows 7, PowerShell, and Posh-Git. I have the following alias setup: ls = log --pretty=tformat:"%C(yellow)%h\\ %C(green)[%ad]%C(cyan)\\ <%cn>\\ %C(reset)%s%C(auto)%d" The problem was that when I pipe the output to clip.exe to copy it to the clipboard, it also copies some characters for the colors. A little reading and I found you could add "auto," so that it would use the default colors if the --no-color option is specified. So now I have: ls = log --pretty=tformat:"%C(auto,yellow)%h\\ %C(auto,green)[%ad]%C(auto,cyan)\\ <%cn>\\ %C(auto,reset)%s%C(auto)%d" The

How to update posh-git

旧城冷巷雨未停 提交于 2019-12-05 04:56:30
I have an old version of posh-git that I want to update (while trying to solve slow powershell start ups) I've pulls latest from the repo and when I am trying to do .\install.ps1 I get It seems posh-git is already installed... How do I update posh-git? All it does is look if the script is being sourced in your profile: $profileLine = ". '$installDir\profile.example.ps1'" if(Select-String -Path $PROFILE -Pattern $profileLine -Quiet -SimpleMatch) { Write-Host "It seems posh-git is already installed..." return } Since it seems to have the installDir as the folder from which you run the install

The term 'Install-Module' is not recognized as the name of a cmdlet

℡╲_俬逩灬. 提交于 2019-12-04 02:44:55
问题 I am following the directions to install poshgit. In doing so I ran: Install-Module posh-git Error: The term 'Install-Module' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and t ry again. I ran $PSVersionTable.PSVersion : result = 2.0.-1.-1 Is Install-Module an addon? How can I run this command? 回答1: Another GUI based option to fix this error is to download the