gpt4 book ai didi

git commit -m 与 git commit -am

转载 作者:IT王子 更新时间:2023-10-29 00:41:26 35 4
gpt4 key购买 nike

看起来很简单,但我就是不明白。我在我的应用程序的根目录中。

这是我的工作流程。

git add .
git commit -m "added a new feature some files changed"
git push heroku master

这通常有效。我的所有更改都已推送。

但有时我有一个我更改的文件,但是当我推送到 Heroku 时,那个文件的更改不存在......但对于大多数文件来说,更改在那里......

但如果我这样做

git add .
git commit -am "added a new feature some files changed"
git push heroku master

一切(所有更改)都被推送到 Heroku

最佳答案

来自 the docs :

git commit -a automatically stage all tracked, modified files before the commit If you think the git add stage of the workflow is too cumbersome, Git allows you to skip that part with the -a option. This basically tells Git to run git add on any file that is "tracked" - that is, any file that was in your last commit and has been modified. This allows you to do a more Subversion style workflow if you want, simply editing files and then running git commit -a when you want to snapshot everything that has been changed. You still need to run git add to start tracking new files, though, just like Subversion.

使用选项 -am 允许您在一个命令中为提交添加和创建消息。

关于git commit -m 与 git commit -am,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19877818/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com