Description
When using the -b/--branch flag with a private GitHub repository, gitingest clones and checks out the default branch (e.g., release) instead of the specified branch. The output contains the default branch's files, not the target branch's files.
Steps to Reproduce
# Clone a specific feature branch from a private repo
gitingest -b my-feature-branch \
-t "$GITHUB_TOKEN" \
-o /tmp/output.txt \
https://github.com/org/repo
Expected Behavior
The output should contain the file tree and contents from my-feature-branch.
Actual Behavior
The output contains the file tree and contents from the default branch (release).
Looking at the logs, gitingest runs:
git clone --single-branch --no-checkout --depth=1 <url> <local-path>
Then checks out a commit that belongs to the default branch, not the specified branch:
Checking out commit | {"commit":"11c94773..."} # ← this is the default branch HEAD
The actual branch tip is a different SHA (6a44be78... per GitHub API).
Verification
I verified this is a gitingest issue, not a repo issue:
# GitHub API confirms the branch exists and has different content
gh api repos/org/repo/branches/my-feature-branch --jq '.commit.sha'
# Returns: 6a44be78... (different from what gitingest checked out)
# GitHub compare shows 120 commits ahead with 285 changed files
gh api repos/org/repo/compare/release...my-feature-branch --jq '.ahead_by'
# Returns: 120
Scope
Tested with 4 different branches on the same private repo — all 4 produced byte-identical output matching the default branch. This is not branch-specific.
Environment
- gitingest: 0.3.1 (latest)
- Python: 3.13
- OS: macOS (Darwin 25.4.0)
- Auth: GitHub PAT via
-t flag
- Repo: Private GitHub repository with non-
main default branch (release)
Description
When using the
-b/--branchflag with a private GitHub repository,gitingestclones and checks out the default branch (e.g.,release) instead of the specified branch. The output contains the default branch's files, not the target branch's files.Steps to Reproduce
Expected Behavior
The output should contain the file tree and contents from
my-feature-branch.Actual Behavior
The output contains the file tree and contents from the default branch (
release).Looking at the logs,
gitingestruns:Then checks out a commit that belongs to the default branch, not the specified branch:
The actual branch tip is a different SHA (
6a44be78...per GitHub API).Verification
I verified this is a gitingest issue, not a repo issue:
Scope
Tested with 4 different branches on the same private repo — all 4 produced byte-identical output matching the default branch. This is not branch-specific.
Environment
-tflagmaindefault branch (release)