【问题标题】:Git: show message when cloningGit:克隆时显示消息
【发布时间】:2016-07-10 07:47:20
【问题描述】:

当我从我的 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 服务器上做类似的事情。克隆时如何发送要打印的消息?

【问题讨论】:

  • 你的 git 服务器是什么?纯git?但桶? github?石榴石? GitLab?等等...哪个版本?你用 ssh 吗?
  • 这是一个运行 Ubuntu 的纯 git 服务器。我使用 ssh。

标签: git azure-devops


【解决方案1】:

没有可以使用的钩子,但如果您使用ssh,您可以使用以下代码将横幅打印到标准错误:

cat 1>&2 << "banner"
remote:  _   _      _ _        __        __         _     _
remote: | | | | ___| | | ___   \ \      / /__  _ __| | __| |
remote: | |_| |/ _ \ | |/ _ \   \ \ /\ / / _ \| '__| |/ _` |
remote: |  _  |  __/ | | (_) |   \ V  V / (_) | |  | | (_| |
remote: |_| |_|\___|_|_|\___/     \_/\_/ \___/|_|  |_|\__,_|
banner

以下文件之一取决于您的 ssh 使用情况:

  • /etc/sshrc
  • ~/.ssh/rc

【讨论】:

  • @Jepessen 看起来像。我在 git 文档中没有找到任何内容
  • 这是某种 SSH 的东西吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-09-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-08-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多