visual-studio-code - Differences between Commit, Commit Staged, and Commit All in VS Code
问题描述
There are three commands for Git committing in Visual Studio Code:
- Commit
- Commit Staged
- Commit All
What are the differences between them?
I expect Commit Staged works as a regular
git commit
command.I’ve found that Commit All commits unstaged and untracked files, too. (Similarly to Commit All in the “classic” Visual Studio.)
However, what does Commit do, and how does it differ from the two commands above?
Unfortunately, I have not found any documentation or web pages on this. (I am not interested in the differences between git pull
and git fetch
or commit – amend or commit – signed off as most searches suggest – all of these are documented well. The Commit command is also missing in the comprehensive list in the German article Visual Studio Code (7): Git als Quellcodeverwaltung einsetzen, for example.)
解决方案
我通过git log 窗口观察了 VS Code 的行为,我发现commit
andcommit all
选项都记录了 agit add -A -- .
所以结果是一样的。
> git add -A -- .
> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
> git status -z -u
> git symbolic-ref --short HEAD
> git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track) refs/heads/master refs/remotes/master
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
> git ls-tree -l HEAD -- /home/antonio/tmp/vscode/f9
> git show --textconv HEAD:f9
> git status -z -u
> git symbolic-ref --short HEAD
> git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track) refs/heads/master refs/remotes/master
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
在我看来,这可能是一个错误!
推荐阅读
- javascript - 使用角度 8 更改类型和值输入
- ssh - 在 GitHub Actions 上通过 SSH 自连接
- python - python - 遍历列表以格式化
- python - 使用 Tesseract 识别页面上的单个字符
- javascript - 根据网站元素/错误/文本输出创建 iMacros 变量
- sql - 离开加入蜂巢
- javascript - Jquery图像显示/隐藏不起作用
- excel - excel SUMIF没有给出正确答案
- python - 如何使用 Python 在日志文件中复制/捕获标准输出
- python - 如何衡量 python 多处理 map_async 的进度?