Jepessen Jepessen - 3 months ago 15
Git Question

Git: show message when cloning

When I clone a repository from my Visual Studio Team Services (was Visual Studio Online) account I obtain a message in the console during cloning itself:

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.


I'd like to do a similar thing in my git server. How can I send a message to be printed when cloning?

Answer

There is no some hook that you can use, but in case you use ssh you can print the banner to stderr using this code:

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

in one of the following files depends on your ssh usage:

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