709 B
709 B
- init: Create new .ugit directory
The ‘ugit init’ command creates a new empty repository.
Git stores all repository data locally, in a subdirectory called “.git”, so upon initialization we’ll create one.
I named the directory “.ugit” rather than “.git” so that it doesn’t clash with Git, but the idea is the same.
To implement ‘init’, we could have just called os.makedirs from cli.py, but I want to have some separation between different logical parts of the code:
- cli.py - In charge of parsing and processing user input.
- data.py - Manages the data in .ugit directory. Here will be the code that actually touches files on disk.
This separation will be useful as the code will get larger.