如何git提交一个…
通知
清除所有

如何git提交单个文件/目录

RSS

(@anamika)
贵族成员
加入:1年前
帖子:1381
15/05/2021 41点

尝试以下命令:

git提交路径/ /我的/文件。下一个-m 'my notes'

在git版本1.5.2.1中收到一个错误:

错误:pathspec '-m'没有匹配任何已知的文件git。

错误:pathspec 'MY MESSAGE'没有匹配任何已知的git文件。

单个文件或目录提交的语法是错误的吗?


报价
(@abhijith)
贵族成员
加入:1年前
帖子:1350
15/05/2021 41点

对此,正确的语法应该是:

Git commit -m 'my notes' path/to/my/file.ext

然后你可以git提交一个文件目录。


回复报价
分享:
Baidu