(Git) post-receive-email: change destination addresses depending on which branch a update is pushed to
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a git repository and use it as an auto-deploy system on a web page.
The repository has two branches, master and test branch. We develop the web on the test branch and once the test goes well, marge it to the master branch as a product web page.
What I want to do are as follows:
- get notification emails
- when someone pushes his commit to the test branch, the notification email is sent to aaa@gmail.com
- when someone pushes his commit to the master branch, the notification email is sent to bbb@gmail.com
As far as I understand, the destination email addresses are set via a set of commands as follows:
cd repository.git
git config hooks.mailinglist "foobar"
git config hooks.announcelist "foobar"
git config hooks.emailprefix "foobar"
echo foobar > description
It looks like impossible to change the destination addresses depending on which branch updates are pushed to because I think even if I make two post-receive-email-s, like post-receive-email and post-receive-email2, the two scripts share the destination addresses set by git config hooks.mailinglist
.
Is there any workaround of this matter? OR just I'm missing something?
Any advice is appreciated.
git
add a comment |Â
up vote
0
down vote
favorite
I have a git repository and use it as an auto-deploy system on a web page.
The repository has two branches, master and test branch. We develop the web on the test branch and once the test goes well, marge it to the master branch as a product web page.
What I want to do are as follows:
- get notification emails
- when someone pushes his commit to the test branch, the notification email is sent to aaa@gmail.com
- when someone pushes his commit to the master branch, the notification email is sent to bbb@gmail.com
As far as I understand, the destination email addresses are set via a set of commands as follows:
cd repository.git
git config hooks.mailinglist "foobar"
git config hooks.announcelist "foobar"
git config hooks.emailprefix "foobar"
echo foobar > description
It looks like impossible to change the destination addresses depending on which branch updates are pushed to because I think even if I make two post-receive-email-s, like post-receive-email and post-receive-email2, the two scripts share the destination addresses set by git config hooks.mailinglist
.
Is there any workaround of this matter? OR just I'm missing something?
Any advice is appreciated.
git
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a git repository and use it as an auto-deploy system on a web page.
The repository has two branches, master and test branch. We develop the web on the test branch and once the test goes well, marge it to the master branch as a product web page.
What I want to do are as follows:
- get notification emails
- when someone pushes his commit to the test branch, the notification email is sent to aaa@gmail.com
- when someone pushes his commit to the master branch, the notification email is sent to bbb@gmail.com
As far as I understand, the destination email addresses are set via a set of commands as follows:
cd repository.git
git config hooks.mailinglist "foobar"
git config hooks.announcelist "foobar"
git config hooks.emailprefix "foobar"
echo foobar > description
It looks like impossible to change the destination addresses depending on which branch updates are pushed to because I think even if I make two post-receive-email-s, like post-receive-email and post-receive-email2, the two scripts share the destination addresses set by git config hooks.mailinglist
.
Is there any workaround of this matter? OR just I'm missing something?
Any advice is appreciated.
git
I have a git repository and use it as an auto-deploy system on a web page.
The repository has two branches, master and test branch. We develop the web on the test branch and once the test goes well, marge it to the master branch as a product web page.
What I want to do are as follows:
- get notification emails
- when someone pushes his commit to the test branch, the notification email is sent to aaa@gmail.com
- when someone pushes his commit to the master branch, the notification email is sent to bbb@gmail.com
As far as I understand, the destination email addresses are set via a set of commands as follows:
cd repository.git
git config hooks.mailinglist "foobar"
git config hooks.announcelist "foobar"
git config hooks.emailprefix "foobar"
echo foobar > description
It looks like impossible to change the destination addresses depending on which branch updates are pushed to because I think even if I make two post-receive-email-s, like post-receive-email and post-receive-email2, the two scripts share the destination addresses set by git config hooks.mailinglist
.
Is there any workaround of this matter? OR just I'm missing something?
Any advice is appreciated.
git
asked Mar 23 at 12:44
Taiki Bessho
3351214
3351214
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f433049%2fgit-post-receive-email-change-destination-addresses-depending-on-which-branch%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password