❶ 如何使用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>