将输出从Git Bash输出到剪贴板 [英] Piping output from Git Bash to clipboard
问题描述
我经常需要将我的Git输出转发给我友善的代码伙伴。我知道这样做的最好方法是:
右键单击Git Bash标题栏>编辑>标记>选择线路>输入
Bam - 我选择的所有东西放在剪贴板中,我充满了欢乐。
问题是,这是无聊的方式,我喜欢我与Git的关系,充满兴奋和魅力。
在Windows中,您可以将控制台输出传递到您的剪贴板,例如-a:
C:\> dir | clip
令人惊叹的,对吗?那么,当你尝试在Git Bash中做一些事情时,会发生什么:
> git分支| clip
sh.exe:clip:command not found
这让我难过。有没有办法在Windows中将Git Bash输出传递给我的剪贴板,这样我可以再次充满欢乐? 解决方案
,实际上 git branch | clip
对我很好。 clip 命令调用
clip.exe from
C:\Windows\System32\
。确保您有 clip.exe
安装在 PATH
中的某处。
I often need to relay my Git output to my ever-friendly code buddies. The best way I know how is by doing this:
Right-click Git Bash title bar > Edit > Mark > Select lines > Enter
Bam - everything I selected is in my clipboard, and I am filled with joy.
Problem is, that's the boring way, and I like my relationship with Git to be full of excitement and glamour.
In Windows, you can pipe console output to your clipboard like-a so:
C:\> dir | clip
Amazing, right? Well, when you try to do something that in Git Bash, here's what happens:
> git branch | clip
sh.exe": clip: command not found
And that makes me sad. Is there a way to pipe Git Bash output to my clipboard in Windows so I can once again be filled with joy?
Well, actualy git branch | clip
works fine for me. clip
command just calls clip.exe
from C:\Windows\System32\
. Make sure you have clip.exe
installed somewhere in your PATH
.
这篇关于将输出从Git Bash输出到剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!