I have a local directory: /home/Tegra.
I created the following files inside / home / Tegra:
hello_world.c hello_world_1.c hello_world_2.c
Each file changes in stages. I also created patches like:
diff -u hello_world.c hello_world_1.c > hello_world_1.patch diff -u hello_world_1.c hello_world_2.c > hello_world_2.patch
Now I want to first send an email with a git address to an email address abc@xyz.org. , which should contain a hello_world.c file
Then I want to send a second letter with the file hello_world_1.patch as an attachment.
Then I want to send a third email with the hello_world_2.patch file as an attachment.
Unfortunately, I cannot even complete step 1:
My git was configured correctly with the corresponding smtp server tls 587 port.
I tried the following command:
git send-email --to abc@xyz.org --subject My Hello hello_world.c
I get the following error:
Cannot run git format-patch from outside a repository
Where is the repository located? Do I have to save my code repository first.
Edit: for step 1: according to the comments below we need a repository:
- Created an empty repository on Github: "MyRepo"
- Cloning it on a local machine. (using git clone)
- Then the first file "hello_world.c" is added to the / MyRepo directory.
- Then -> git add hello_world.c
- Then -> git commit -m "My first source"
- Then -> git push -u origin master
- After that I typed: git send-email --to=abc@xyz.org --subject = "[asdasdas] assd asdasd" hello_world.c
Now I get the error message:
No subject line in hello_world.c ? at /usr/lib/git-core/git-send-email line 584
source share