linux下git命令生成补丁,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文件

>然后我想发送第二封电子邮件,其中包含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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值