【发布时间】:2012-02-17 13:38:29
【问题描述】:
如何在一个命令中提交和推送所有更改,包括添加、编辑和文件删除等?
【问题讨论】:
标签: git
如何在一个命令中提交和推送所有更改,包括添加、编辑和文件删除等?
【问题讨论】:
标签: git
您必须执行git add -A 来添加所有文件新文件、更改和删除文件。然后用git commit 和git push 跟进
【讨论】:
使用以下命令-
git add -A 添加所有文件新文件、更改和删除文件。git commit -m "Your message" 保存在文件中所做的更改。git push -u origin master 将您提交的更改发送到远程
存储库,其中本地分支被命名为 master 到远程
命名来源【讨论】:
请按照这些命令 git commit -am "message"(在单个命令中添加和提交) git push origin [分支名称]
【讨论】:
commit -a 更新现有文件,但不添加新文件。请参阅git help commit 或尝试一下。
请您尝试以下方法
git commit -a
【讨论】:
git add它们。
据我了解您的问题是关于“-u”选项的使用,如下所示,它将添加所有已经存在的 repo 条目(但没有新条目):
git add -u
根据手册页:
-u, --update Update the index just where it already has an entry matching <pathspec>. This removes as well as modifies index entries to match the working tree, but adds no new files. If no <pathspec> is given when -u option is used, all tracked files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).
【讨论】: