Mik*_*son 57 git bitbucket git-push githooks
我正在对一个分支机构中的项目进行更改,到目前为止,除了我之外,其他人都不知道.但是,从最近开始,当我git push
参与这个项目时,我现在收到这个作为响应的一部分:
remote: Create pull request for <<my branch>>:
remote: https://bitbucket.org/...
Run Code Online (Sandbox Code Playgroud)
我不知道为什么Git会给我这个消息,这是我以前从未见过的.
即使我删除了远程分支(" git push origin :<<my branch>>
"我现在仍然收到此消息!(我成功删除了远程分支,但消息仍然存在)
Tim*_*lla 35
注意:现在可以禁用这些消息.见杰克的回答.请阅读我的答案,了解技术说明.
所有以前缀为前缀的内容都由服务器上的接收脚本1remote:
发送.Bitbucket可能希望让您更容易创建拉取请求.
1用于向用户发送消息的post-receive
钩子的示例,如echo
上面的链接中所述.一旦所有推送的数据完全保存在服务器上,它将被调用:
标准输出和标准错误输出都转发到另一端的git send-pack,因此您可以简单地为用户回显消息.
在服务器上:
git@example.com:~/stackoverflow.git/hooks$ cat post-receive
#!/bin/bash
echo "This is an example of a git hook running at the server"
Run Code Online (Sandbox Code Playgroud)
在客户端:
$ git push git@example.com:stackoverflow.git master:master
Counting objects: 1, done.
Writing objects: 100% (1/1), 187 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
remote: This is an example of a git hook running at the server
To git@example.com:stackoverflow.git
4751391..01882eb master -> master
Run Code Online (Sandbox Code Playgroud)
hdl*_*hdl 24
我认为TimWolla是对的,但我只想在Atlassian上添加这篇文章,其中阐明了Atlassian的政策:
在Stash 3.3中,添加了一个功能,用于向终端中的用户显示一条消息,其中包含一个链接,用于在推送没有拉取请求的新分支或分支时创建拉取请求.本指南将说明如何关闭此功能.
Run Code Online (Sandbox Code Playgroud)remote: remote: Create pull request for ABC-123-fix-bug: remote: http://localhost:7990/projects/PROJ/repos/REPO/compare/commits?sourceBranch=refs/heads/ABC-123-fix-bug remote:
目前,此功能只能全局打开或关闭.[...]
要关闭此功能,请执行以下操作:
- 导航到Stash管理员屏幕的"管理加载项"部分
- 从下拉列表中选择"系统"
- 搜索'Bundled Hooks'扩展它及其模块
- 找到'print-branch-links-hook'模块,单击Disable