linux – 无法使用git send-email发送源代码和补丁
我在本地创建了一个目录:/ 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文件 不幸的是,我甚至无法完成第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” 现在我收到一个错误: No subject line in hello_world.c ? at /usr/lib/git-core/git-send-email line 584 解决方法
首先确保您已经在克隆的空仓库中实际提交了任何内容. git add . git commit -m "new commit" git push 其次, --subject=<string>
一定要使用–compose.
这适用于.patch,而不是源本身. 对于最后一次提交: git send-email -1 --to=abc@xyz.org --subject="[asdasdas] assd asdasd" 第三,一个更简单的解决方案是use (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |