HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
ingydotnet
git-subrepo
Shell2014–2026
ingydotnet / git-subrepo

git-subrepo

Discover this repository through its Hacker News conversations.

25Distinct people
36Mentions
0Explicit recommenders
3.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A public description has not been verified.

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year36 dated mentions

Observed mentions: 2014-02-24 21:39:05 UTC to 2026-07-27 11:23:58 UTC.

02462014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 3 submissions, 0 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC312
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC312
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC312
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC303
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC303
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC330
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC413
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC202
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC413
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC615
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Name git-subrepo - Git Submodule Alternative Synopsis git subrepo -h # Help Overview git subrepo clone <remote-url> [<subdir>] git subrepo init <subdir> git subrepo pull <subdir> git subrepo push <subdir> git subrepo fetch <subdir> git subrepo branch <subdir> git subrepo commit <subdir> git subrepo config <subdir> git subrepo status [<subdir>] git subrepo clean <subdir> git subrepo help [<command> | --all] git subrepo version git subrepo upgrade Description This git command "clones" an external git repo into a subdirectory of your repo. Later on, upstream changes can be pulled in, and local changes can be pushed back. Simple. Benefits This command is an improvement from git-submodule and git-subtree; two other git commands with similar goals, but various problems. It assumes there are 3 main roles of people interacting with a repo, and attempts to serve them all well: owner - The person who authors/owns/maintains a repo. users - People who are just using/installing the repo. collaborators - People who commit code to the repo and subrepos. The git-subrepo command benefits these roles in the following ways: Simple and intuitive commandline usage (with tab completion). Users get your repo and all your subrepos just by cloning your repo. Users do not need to install git-subrepo, ever. Collaborators do not need to install unless they want to push/pull. Collaborators know when a subdir is a subrepo (it has a .gitrepo file). The .gitrepo file never gets pushed back to the subrepo upstream. Well named branches and remotes are generated for manual operations. Owners do not deal with the complications of keeping submodules in sync. Subrepo repositories can contain subrepos themselves. Branching with subrepos JustWorks™. Different branches can have different subrepos in different states, etc. Moving/renaming/deleting a subrepo subdir JustWorks™. You can init an existing subdirectory into a subrepo. Your git history is kept squeaky clean. Upstream history (clone/pull) is condensed into a single commit. Pulls can use a merge, rebase or force strategies. You can see the subrepo history with git log subrepo/<subdir>/fetch. Commits pushed back upstream are not condensed (by default). Trivial to try any subrepo operations and then reset back. No configuration required. Does not introduce history that messes up other git commands. Fixes known rebase failures with git-subtree. Installation The best short answer is: git clone https://github.com/ingydotnet/git-subrepo /path/to/git-subrepo echo 'source /path/to/git-subrepo/.rc' >> ~/.bashrc The complete "Installation Instructions" can be found below. Note: git-subrepo needs a git version >= 2.23) due to changes in --is-ancestor. Commands All the subrepo commands use names of actual Git commands and try to do operations that are similar to their Git counterparts. They also attempt to give similar output in an attempt to make the subrepo usage intuitive to experienced Git users. Please note that the commands are not exact equivalents, and do not take all the same arguments. Keep reading… git subrepo clone <repository> [<subdir>] [-b <branch>] [-f] [-m <msg>] [--file=<msg file>] [-e] [--method <merge|rebase>] Add a repository as a subrepo in a subdir of your repository. This is similar in feel to git clone. You just specify the remote repo url, and optionally a sub-directory and/or branch name. The repo will be fetched and merged into the subdir. The subrepo history is squashed into a single commit that contains the reference information. This information is also stored in a special file called <subdir>/.gitrepo. The presence of this file indicates that the directory is a subrepo. All subsequent commands refer to the subrepo by the name of the subdir. From the subdir, all the current information about the subrepo can be obtained. The --force option will "reclone" (completely replace) an existing subdir. The --method option will decide how the join process between branches are performed. The default option is merge. The clone command accepts the --branch= --edit, --file, --force and --message= options. git subrepo init <subdir> [-r <remote>] [-b <branch>] [--method <merge|rebase>] Turn an existing subdirectory into a subrepo. If you want to expose a subdirectory of your project as a published subrepo, this command will do that. It will split out the content of a normal subdirectory into a branch and start tracking it as a subrepo. Afterwards your original repo will look exactly the same except that there will be a <<subdir/.gitrepo >> file. If you specify the --remote (and optionally the --branch) option, the values will be added to the <subdir>/.gitrepo file. The --remote option is the upstream URL, and the --branch option is the upstream branch to push to. These values will be needed to do a git subrepo push command, but they can be provided later on the push command (and saved to <<subdir/.gitrepo >> if you also specify the --update option). Note: You will need to create the empty upstream repo and push to it on your own, using git subrepo push <subdir>. The --method option will decide how the join process between branches are performed. The default option is merge. The init command accepts the --branch= and --remote= options. git subrepo pull <subdir>|--all [-M|-R|-f] [-m <msg>] [--file=<msg file>] [-e] [-b <branch>] [-r <remote>] [-u] Update the subrepo subdir with the latest upstream changes. The pull command fetches the latest content from the remote branch pointed to by the subrepo's .gitrepo file, and then tries to merge the changes into the corresponding subdir. It does this by making a branch of the local commits to the subdir and then merging or rebasing (see below) it with the fetched upstream content. After the merge, the content of the new branch replaces your subdir, the .gitrepo file is updated and a single 'pull' commit is added to yo
Read the full README on GitHub

What Hacker News says

36 sources
Git Subrepo is another alternative to submodules and subtree. > This git command clones an external git repo into a subdirectory of your repo. Later on, upstream changes can be pulled in, and local changes can be pushed back. Simple. https://github.com/ingydotnet/git-subrepo After trying many similar solutions, it gets the closest to what I want to achieve, which is nested Git repositories. A project with subprojects, each of which can be an independent Git repo with its own history to push/pull, while the project itself has the entire codebase and history. It's written in Bash, so fairly portable. --- Edit: After skimming through the project vdm, I see the problems it aims to solve are different from what git-subrepo does. The latter is more about monorepos. Ah well, that's what I get for commenting before reading the post. vdm does look
Read the rest
useful for managing a project with external dependencies, which are Git repos owned by others or oneself. Maybe like a language-agnostic package manager.
In Show HN: Vdm, a sane alternative to e.g. Git submodules
Where I work we just package everything (nugets, python packages, npm) on our Artifactory. Contracts dependencies (DLLs, protobufs) are also distributed as packages. We made it easy to fetch and test the source and allow developers to develop, debug and test those dependencies with their own project if needed. Every time we try to assemble repositories in macro-repos we always end up regretting it. Multiple dedicated repositories allow autonomy for teams and enforce modularity and coding as a library. Monorepos have a tendency of becoming huge merge trains easily and often derailed and with lots of fear of being blamed on stepping on someone else's toes. We update often all our projects knowing full well that not doing so is just borrowing development time at high interest rate. As a side-note when we do have to do an assembly of differen
Read the rest
t code base, we use git-subrepo: https://github.com/ingydotnet/git-subrepo which provide the best of both submodules and subtree.
In Just use a monorepo
git subrepos are an alternative to git submodules and git subtrees. https://github.com/ingydotnet/git-subrepo git subrepos work simply by copying your dependency to a subdirectory and committing the changes using one large commit that retains metadata about the update to the subrepo. For that reason, git subrepos aren't symlinks. You don't need to git clone --recursive like with git submodules, and you don't need cross-repo authentication. Updating a subrepo means performing another commit. Even though git subrepos are the most poorly maintained, the design is simpler. I wish someone would fork and take over maintenance. git subrepos are the best.
In Show HN: Get rid of Git submodules and never look back (now for GitHub users)

Showing the 15 most recent of 36 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.