首页 > 解决方案 > How to pipe text into stdin

问题描述

I want to do something like

cat "username\npassword" | git push so that git gets the username and password since it expects the first line of stdin as username and second line of stdin as password but it doesnt work.

What am i doing wrong

标签: linuxunixpipestdin

解决方案


Git specifically reads from the terminal, it does not just read from stdin (that's why you won't see your password displayed in the terminal). Most applications taht read a password will work like that.

You need to use one of Git's non-interacitve authentication methods.


推荐阅读