❶ 如何使用git send-email
安装 send-email
你的git可能已经安装了,但是send-email命令不是git必需的组件。你可以使用“git send-email --help”
确认一下。如果显示send-email的man
page,那么send-email已经安装再你的系统了。否则,你需要安装send-email命令。你的版本可能有一个send-email的安装包。在Debian下,这个安装包的名字是"git-email"
。
配置你的名字和Email地址
你应该告诉git你的名字和email地址。你可能已经做了这一步了,如果没有,执行下面的命令:
git config --global user.name "My Name"
git config --global user.email "[email protected]"
配置Mail发送选项
git send-email 发送emails通过你的SMTP 服务器, 所以你需要配置服务器参数。参考你的email提供商的文档找到正确的参数。下面是我的mail设置:
git config --global sendemail.smtpencryption tls
git config --global sendemail.smtpserver mail.messagingengine.com
git config --global sendemail.smtpuser [email protected]
git config --global sendemail.smtpserverport 587
git config --global sendemail.smtppass hackme
配置默认的目的地址
git config sendemail.to [email protected]
避免发送邮件给你自己
默认情况下,git send-email会把作者添加到Cc:field. 当你发送你自己写的patches,
这意味着每个patch的拷贝都会发送到你自己的邮箱. 如果你不喜欢这样, 你可以通过设置下面的选项来避免这种情况(see "git
send-email --help" for the full list of possible values):
git config --global sendemail.suppresscc self
发送一个单独的Patch
在当前的分支发送最新的commit:
git send-email -1
发送其他的commit:
git send-email -1 <commit reference>
发送多个Patches
Sending the last 10 commits in the current branch:
git send-email -10 --cover-letter --annotate
❷ 如何在gitlab里面设置邮件提醒
例子 1
把字符串变量($str)的值写入输出:
<?php
$str = "Hello world!";
echo $str;
?>
例子 2
把字符串变量($str)的值写入输出,包括 HTML 标签:
<?php
$str = "Hello world!";
echo $str;
echo "<br>What a nice day!";
?>
例子 3
连接两个字符串变量:
<?php
$str1="Hello world!";
$str2="What a nice day!";
echo $str1 . " " . $str2;
?>
例子 4
把数组值写入输出:
<?php
$age=array("Peter"=>"35");
echo "Peter is " . $age['Peter'] . " years old.";
?>
例子 5
把文本写入输出:
<?php
echo "This text
spans multiple
lines.";
?>
运行实例
例子 6
如何使用多个参数:
<?php
echo 'This ','string ','was ','made ','with multiple parameters.';
?>
例子 7
单引号和双引号的区别。单引号将输出变量名称,而不是值:
<?php
$color = "red";
echo "Roses are $color";
echo "<br>";
echo 'Roses are $color';
?>
例子 8
简化语法(只适用于 short_open_tag 配置设置启用的情况):
<?php
$color = "red";
?>
<p>Roses are <?=$color?></p>