Is it possible to copy remote origin url to clipboard using Bash on Mac (Darwin 17)?

279 views Asked by At

I've tried one command line: pbcopy < git remote get-url origin

And other way: output.txt < git remote get-url origin

But I get next message:

-bash: git: No such file or directory

Any ways?

P.S. Git version: 2.13.3, OS Version: macOS High Sierra (Darwin 17).

1

There are 1 answers

3
Mateusz Chrzaszcz On BEST ANSWER

If you want to redirect output to file output.txt it would be: git remote get-url origin > output.txt

For clipboard do: git remote get-url origin | pbcopy