Git remote 推送后打印一条彩色消息

标签 git

当我在命令行上看到这个奇怪的彩色输出时,我正在将我的代码推送到我的远程仓库:

Multicoloured pattern

我不知道那是什么意思。我弄坏了什么吗?

最佳答案

它是什么

来自 Bitbucket support 4 天前:

This message is in honor of the pride celebrations here in San Francisco. From time to time we add images to the push process and/or UI to recognize holidays and current events. It is simply a nod to the great diversity of our customers, employees, and integrators.

如何禁用

You can turn off the terminal message by going to Bitbucket settings, and unchecking Console messages under Profile. The UI logo will be restored back to our normal Bitbucket logo next week.


远程服务如何打印自定义消息

真的,这一切都归结为 git 和您可以用来响应传入请求以更改存储库的 3 个 Hook :

  • 预接收
    • 每次有人使用 git push 将提交推送到存储库时执行。在更新任何内容之前调用。
  • 更新
    • pre-receive 之后调用,其工作方式大致相同。它仍然在任何实际更新之前被调用,但它会为每个被推送的引用单独调用。
  • 接收后
    • 在成功的推送 操作后调用,使其成为执行通知的好地方

所以从手头的话题来看,我可以肯定地说 bitbucket 可能使用了他们平台中内置的 post-receive Hook 服务来发送 ASCII原帖中的艺术。还值得一提的是,他们最近添加了一些其他消息,最值得注意的是,一条消息提供了为您刚刚推送到的分支创建 pull 请求的直接链接(只要它不是主分支)。

此类技术的其他更值得注意的用途

希望对您有所帮助!

关于Git remote 推送后打印一条彩色消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51006115/

相关文章:

git - egit 和 git unstaged 文件显示不同的状态

c++ - Qt: init-repository 以 "fatal: Needed a single revision"中止

git - 在 Centos 5 EC2 上安装 git

git - 为什么 git 无法识别我的本地存储库?

Git:跟踪权限更改 777 到 444

git - 将 GIT 存储库更改为共享

git - 与 Github for Mac 应用程序同步时出错

git - 如何将已克隆的项目添加为子模块?

git - VS 团队资源管理器 merge 冲突

git - 恢复 git merge --abort 后删除的 git 文件