git发邮件

 


1.发单个patch


git status 检查状态


git commit 提交修改,提交了之后才能format-patch


git format-patch -1 -s
 
vim 0001-A-test-patch.patch   add some comment
 
git send-email 0001-A-test-patch.patch   --to [email protected] --cc [email protected]


2.发patch set
 1043  git format-patch -2 -s --cover
 1044  vim 0000-cover-letter.patch 
 1046  vim 0001-Move-the-definition-of-struct-mapped_device-and-stru.patch 
 1052  vim 0002-Add-the-new-interface-for-multipath-to-limit-the-tim.patch 
 1054  mkdir send-patch
 1055  mv 000* send-patch/
 1056  git send-email send-patch/ --to [email protected] 
 1062  git send-email send-patch/ --to [email protected] --cc [email protected]


方法一:
[root@yuxh linux-2.6]# cat .git/config 
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git://10.167.225.115/git/linux-2.6/.git
[branch "master"]
remote = origin
merge = refs/heads/master
[user]
name = Bc A
email = [email protected]
[sendemail]
smtpserver = 邮件服务器URL
smtpuser = 邮件服务器用户名:[email protected]
smtpserverport = 25
[root@yuxh linux-2.6]# 




方法二:
配置两个文件  ~/.gitconfig   ~/.msmtprc


#cat ~/.gitconfig




[user]
    email = [email protected]
    name = Bc A
[color]
    ui = true                                                                                                                                                 
[sendemail]
    #smtpencryption = tls
    smtpserver = /usr/bin/msmtp
    smtpuser = [email protected]


#cat ~/.msmtprc


defaults
logfile ~/.msmtp.log


#gmail
account abc
protocol smtp
host 邮件服务器url
from [email protected]
user [email protected]
password abc
port 25
auth login
#tls on
#tls_trust_file /etc/ssl/certs/ca-certificates.crt
syslog LOG_MAIL 


# Set a default account
account default : abc

你可能感兴趣的:(linux相关)