Created
July 13, 2022 05:01
-
-
Save viercc/0d577954cc7f20abf71be3437376a909 to your computer and use it in GitHub Desktop.
Using git-status to tell if it's "nothing-to-commit" status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ls | |
foobar.txt hoge.txt piyo.txt | |
$ git status | |
ブランチ main | |
Changes not staged for commit: | |
(use "git add <file>..." to update what will be committed) | |
(use "git restore <file>..." to discard changes in working directory) | |
modified: hoge.txt | |
追跡されていないファイル: | |
(use "git add <file>..." to include in what will be committed) | |
piyo.txt | |
no changes added to commit (use "git add" and/or "git commit -a") | |
$ git status --porcelain | |
M hoge.txt | |
?? piyo.txt | |
$ git status --porcelain | grep '^[MTADRCU]' | wc -l | |
0 | |
$ git add hoge.txt | |
$ git status --porcelain | |
M hoge.txt | |
?? piyo.txt | |
$ git status --porcelain | grep '^[MTADRCU]' | wc -l | |
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment