Two things I like in Git
I discovered two Git features that completely changed the way I code: features most developers completely take for granted
Two things I like in git
It makes copies of codes easily
It tracks changes
What’s so important in making copies of codes?
Modifying the code directly is destructive.
Modifying it’s copy is not
If you want to add a new feature
Create a copy
Modify it
Test it
Review it
Commit the changes to original copy
#1 Making mistakes is cheap.
Just discard the modified copy.
Create a new one from the original with one single command
If you don’t want to discard the entire modified copy, you can revert to specific checkpoint of your code
Entire Copy
—> Checkpoint 1
—> Checkpoint 2
—> Checkpoint 3
These checkpoints are called commits
#2 Copies enable decoupling
It make things in order
Deployed application that is used by users used stable copy
Copy A: Production Copy
Development team will consolidate their latest changes in a separate copy
Copy B: Develop Copy
Development team will consolidate their changes to be release to users in a separate copy
Copy C: Release Copy
If the member wants to add a new feature. It will create another copy
Copy D: Feature Copy
If the member wants to resolve a bug. It will create another copy again
Copy E: Bugfix Copy
If the member wants to release a blocker bug. It will create another copy again
Copy F: Hotfix Copy
without copy it would be CHAOS
Changes that is not planned for release are now accessible for users
Feature that is not yet tested is already mixed with other developer changes
You’re don’t have a chance to reproduce a bug because the code continuously changing.
What about tracking changes?
Tracking changes is the foundation of repository
Repository is the foundation of making copies
Something must be existed to make copies for.
It’s called repository.
These repository have a lifecycle
User make changes
User choose changes
User commit changes
Rinse and repeat
The foundation of this is tracking changes.
We cannot separate what is code being written vs what code that is tested. Every changes is assumed part of the repository.



