Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
•	In my work, network element configuration files downloaded automatically in hourly basis to the 3rd party server, I have configured the folder where the files downloaded on it as local Repo.
•	Recently, git schedule created to check the differences between the existing files with new downloaded files as below

cmd /c ""C:\Program Files\Git\bin\bash.exe" --login -i -- D:\test.sh"

D:\test consist the following commands

cd d:/repo
git diff -U5 | tail +3

•	The above task created using windows Task Scheduler to difference between the existing files and new files, the results appear as shown in below example diff

  alias Eth-Trunk3
- !ip address xx.xx.xx.xx
+ !ip address xx.xx.
  vrrp vrid 2 virtual-ip xx.xx.xx.xx master

#
-interface GigabitEthernet0/0/5
+
  description To_ISP

#
-interface LoopBack0
+!interface LoopBack0
  alias LoopBack0

Using git bash, how can send automatic email for all the changes appear above in hourly basis, what I mean is after the scheduler executed and appear differences I need to send all the differences appear by email.


What I have tried:

I have read some articles about
git send-email
&
git-format-patch
but I couldn't impelement it
Posted
Updated 26-Jan-21 20:49pm
Comments
raddevus 23-Jan-21 15:12pm    
Did you set up the SMTP options (outgoing server) for the outgoing email?
--smtp-server=<host>
--smtp-server-port=<port>
see more at: https://git-scm.com/docs/git-send-email
Khairi Khaled 24-Jan-21 8:59am    
Yes, I set up SMTP option in git-config but after that, I don't know any idea how to send the result by email
After set up SMTP what should I do?

1 solution

Maybe this article will be of help: HowToUseGitSendEmail[^]

If you use Gmail:
Go to Google -> My Account -> Connected Apps & Sites -> Allow less secure apps -> Switch ON
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900