✓
the short answer

The Trees API lets you build an entire directory tree of blobs (file contents) in memory, attach it to a single commit, and update the branch reference once. This means all files land in exactly one commit, atomically.

📖 Introduction

Pushing dozens of files to GitHub one by one would be slow and risk partial failures. Push44 instead uses the GitHub Trees API to build a complete commit in a handful of API calls.

The Problem with Walled Gardens

The naive approach — using the Contents API to create or update each file individually — requires one API call per file and creates one commit per file, which is both slow and pollutes your commit history.

The Push44 Solution

The Trees API lets you build an entire directory tree of blobs (file contents) in memory, attach it to a single commit, and update the branch reference once. This means all files land in exactly one commit, atomically.

Step-by-Step Walkthrough

5 steps
1

Create blobs for each file

Every file's content is uploaded as a 'blob' object via the Git Data API, returning a SHA hash for each.

2

Build a tree

A 'tree' object is created that maps every file path to its blob SHA, recreating your project's folder structure exactly.

3

Create a commit

A commit object is created that points to the new tree and references the previous commit as its parent, preserving history.

4

Update the branch reference

Finally, the branch pointer (e.g. 'refs/heads/main') is updated to point at the new commit — this is the single step that makes the push visible on GitHub.

5

Handle empty repositories separately

Brand new repos with no commits yet don't have a HEAD reference, so Push44 detects this case and creates the very first commit differently before switching to the standard tree-based flow.

Pro Recommendations

✓

This is the same technique used by advanced git tooling for bulk file operations — Push44 brings it to a no-code UI.

✓

Because the branch reference update is the last step, your repo is never left in a half-pushed state.

Common Pitfalls to Avoid

⚠️

Assuming a failed export means partial data was written — with the Trees API, nothing is visible until the very last step succeeds.

Frequently Asked Questions

Does this approach work for repositories with hundreds of files?

Yes. The Trees API is designed for exactly this — GitHub itself uses similar tooling internally for bulk operations.

Why does my commit show all files as 'added' the first time?

On your very first push to a new (or empty) repository, there's no prior tree to diff against, so every file appears as added in that first commit.

100% free · zero backend · client-side

Export and push your code in seconds.

Connect your platform, preview the visual diff, and create atomic commits on GitHub with zero server data retention.

Start exporting now → Learn more