我在本地创建了一个目录:/ home / Tegra.
我在/ home / Tegra中创建了以下文件:
hello_world.c hello_world_1.c hello_world_2.c
每个文件都是逐步修改的.我还创建了补丁:
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
>现在我想首先使用git send-email向电子邮件地址abc@xyz.org发送电子邮件.其中应包含hello_world.c文件
>然后我想发送第二封电子邮件,其中包含hello_world_1.patch文件作为附件.
>然后我想发送第三封电子邮件,其中包含hello_world_2.patch文件作为附件.
不幸的是,我甚至无法完成第1步:
我的git已经正确配置了相关的smtp服务器tls 587端口.
我尝试了以下命令:
git send-email --to abc@xyz.org --subject My Hello hello_world.c
我收到以下错误:
Cannot run git format-patch from outside a repository
存储库在哪里出现.我应该首先维护我的代码库.
编辑:对于第1步:根据下面的评论,我们需要一个存储库:
>在Github上创建了一个空存储库:“MyRepo”
>在本地计算机上克隆它. (使用git clone)
>然后将第一个文件“hello_world.c”添加到Directory / MyRepo中.
>然后>> git add hello_world.c
>然后>> git commit -m’我的第一个来源’
>然后>> git push -u origin master
>之后,我输入:git send-email –to = abc@xyz.org –subject =“[asdasdas] assd asdasd”hello_world.c
现在我收到一个错误:
No subject line in hello_world.c ? at /usr/lib/git-core/git-send-email line 584