Welcome to the [git] Machine

I built a finite state machine for Git using xstate, a Javascript library for building state machines. Click the different git commands (below, left) to demonstrate the state of a changeset in Git. The assumption of this state machine is that it only represents the state of a single file change. For example, cat "Hello" > file.txt is idempotent and always produces a file called file.txt with the string Hello, as opposed to cat "Hello" >> file.txt, which would result in an additional change set by appending more changes to the existing file.

I have made the source code available for this site GitHub, which you can find here: warriorpostman/git-as-state-machine

no_changes
⬇️
unstaged
⬇️
staged
⬇️
committed
Legend:
This
is a potential state.
This
is the current state.