

This means that it allows you to switch back and forth between different versions (even if development has diverged into different branches) and it also allows multiple developers to work on the same project.Īlthough tracking your. Git is, as you probably already know, a distributed version control system. gitignore to ignore files that are created by your IDE or operating system) gitignore should be tracked by Git (and should therefore not be ignored).

The flag is also available for commands like push or blame.First of all, as many others already said, your. If you want to find out more about version two, head over to git status documentation.įor advanced automation using git, -porcelain is the way to go. Without a defined version -porcelain uses the v1 format that you have seen in this post. The last thing I learned is that -porcelain comes with different included versions (remember the backward compatibility promise). That's cool! Different versions of git status -porcelain porcelain guarantees that there won't be backward-incompatible changes to the output so that your scripts won't break with a git update.įor compact display with color guidance, you can use git status -s, and if you're automating git workflows, you can use git status -porcelain. In that case, you don't want to have help text and terminal colors included in the output.Īdditionally, you also don't want that the output differs from git version to git version. Imagine running some automation that checks the status of a git repository before running further commands.


So why's that? It turns out that the -porcelain flag is used to generate output that is script-parseable. The difference between git status -s and git status -porcelain This formatting and color highlighting are missing when using -porcelain. This highlighting makes it easier to read. Git status -s highlights the characters that give information on the files' status. > git status -sĪt first look, these two flags seem to be very similar, but there is one difference that is only visible in the terminal. After reading the documentation, I found out there is also a -s or -short flag. Using git status with the -porcelain flag is more efficient. When you run git status with the -porcelain flag, the displayed information looks as follows: > git status -porcelain All I care about are files and their status. While this is not a problem, it shows a lot of information that I'm not interested in as a daily git user. No changes added to commit (use "git add" and/or "git commit -a")Īs you see, the default output of git status is very wordy. " to discard changes in working directory) (use "git push" to publish your local commits) Your branch is ahead of 'origin/master' by 1 commit. I have used git for years now, and I usually go with the "normal" git status command, whose output is very verbose. Three ways to control the output of git status
