git commit -m 与 git commit -am 的区别
为情所困
为情所困 2017-05-02 09:36:32
[Git讨论组]

麻烦解答下 git commit -m 与 git commit -am 的区别

为情所困
为情所困

全部回复(1)
给我你的怀抱
git commit -am "str"
#等同于
git commit -a -m "str"

我们运行下

man git commit 

来获取a参数的意义即知区别了。

OPTIONS
-a, --all
Tell the command to automatically stage files that have been modified and >deleted, but new files you have not told Git about are not affected.

意思是说

自动把当前所有修改和删除文件放到栈上,但你没有添加过的不会受影响。

拓展

通常我们提交git的时候都是

git add .
git commit -m "some str"
git push

这三大步,而实际上,你只需要两条命令就够了,除非有新的文件要被添加进去。

git commit -am "some str"
git push
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号