当我从Visual Studio Team Services(Visual Studio Online)帐户克隆存储库时,我在克隆过程中在控制台中获取了一条消息:
Cloning into 'thirdparty/boost'...
remote:
remote: vSTs
remote: vSTSVSTSv
remote: vSTSVSTSVST
remote: VSTS vSTSVSTSVSTSV
remote: VSTSVS vSTSVSTSV STSVS
remote: VSTSVSTSvsTSVSTSVS TSVST
remote: VS tSVSTSVSTSv STSVS
remote: VS tSVSTSVST SVSTS
remote: VS tSVSTSVSTSVSts VSTSV
remote: VSTSVST SVSTSVSTs VSTSV
remote: VSTSv STSVSTSVSTSVS
remote: VSTSVSTSVST
remote: VSTSVSTs
remote: VSTs (TM)
remote:
remote: Microsoft (R) Visual Studio (R) Team Services
remote:
Receiving objects: 100% (13740/13740), 736.66 MiB | 278.00 KiB/s, done.
我想在我的git服务器上做类似的事情。如何在克隆时发送要打印的消息?
答案 0 :(得分:2)
您可以使用一些钩子,但是如果您使用ssh
,您可以使用此代码将横幅打印到stderr:
cat 1>&2 << "banner"
remote: _ _ _ _ __ __ _ _
remote: | | | | ___| | | ___ \ \ / /__ _ __| | __| |
remote: | |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` |
remote: | _ | __/ | | (_) | \ V V / (_) | | | | (_| |
remote: |_| |_|\___|_|_|\___/ \_/\_/ \___/|_| |_|\__,_|
banner
以下文件之一中的取决于您的ssh用法:
/etc/sshrc
~/.ssh/rc