4 ms·
It's important to train people to be aware of the difference between clean state and dirty state. As long as you avoid dirty state you are guaranteed not to lo
by RichardCA 8y ago
It's important to train people to be aware of the difference between clean state and dirty state.
As long as you avoid dirty state you are guaranteed not to lose work.
You avoid dirty state in three ways.
1. Commit your work frequently in your working branch. You can always squash later using "git reset --soft".
2. Use "git stash".
3. Create throwaway directories if all you want to do is keep your experimental files handy:
mkdir temp
echo '*' >temp/.gitignore
Just like C forces you to be aware of how data structures are allocated internally, git forces you to have hygiene about your local file state.
The only "real" problem is when your git admin fails to pay attention and make sure the top-level .gitignore and .gitattributes are set up correctly.