Consigne - Jeck0v/Guts GitHub Wiki
git hash-object <file>
β
-
Creates a blob object from file content and writes its SHA-1 to stdout.
- β Reject directories or missing files.
git cat-file -t|-p <oid>
β
-
-t
: Print object type.
-
-p
: Pretty-print blob/tree/commit content.
- β Reject invalid OIDs or missing options.
- Create a tree object from the staging area.
- Writes SHA-1 of the tree to stdout.
git commit-tree <tree_sha> -m "msg" [-p <parent>]
β
- Creates a commit object pointing to a tree (and parent commit if any) and writes its oid to stdout
- Requires
-m
message.
- β No annotated tags.
π§βπ» Porcelain Commands
- Initializes a Git repository in the given directory.
- Create .git/objects, .git/refs/heads, HEAD, and minimal config
- Adds files to the staging area (not directories).
- β No
-p
, no wildcards.
- Removes a file from working directory and index.
- Runs
write-tree
, creates a commit with HEAD as parent.
- β No editor or message prompt.
- Shows staged and unstaged changes.
git checkout [-b] <branch|sha>
β
- Switch to existing commit or branch.
-
-b <branch>
creates a new branch.
- Change HEAD, update working dir, check for conflicts
git reset [--soft|--mixed|--hard] <sha>
-
--soft
: move HEAD
-
--mixed
: + reset index
-
--hard
: + reset working directory
- β No file-specific reset.
- Print commit history from HEAD (one-line summary ok).
- List all files in the index.
git ls-tree <tree_sha>
β
- List contents of a tree object.
- Convert ref/branch/HEAD into SHA-1.
- β No complex selectors
- List all refs and their hashes.
π§ Advanced Feature: Merge Support
- Perform 3-way merge and create a merge commit with 2 parents.
- On conflict: insert
<<<<<<<
, =======
, >>>>>>>
markers into file(s).
- β No rebase, squash, or fast-forward-only merges.
- Handle
.gitignore
- Use simple glob-style matching (e.g.,
*.log
, build/
)
- β No negation or nested
.gitignore
files.
π Index Implementation
- You are free to implement the index your way.
- β
Bonus if it matches Gitβs format closely.
-
git push
and git update-index
are NOT required.
- No support for remotes, rebase, tags, or stashing.
- A working implementation of the listed commands.
- Tests and example usage for each.
- Clean error handling for all unsupported cases.
-
Total time: 6β9 days
- Use AI if needed, but understand what you're coding.
β οΈ **GitHub.com Fallback** β οΈ