Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
25 votes
3 answers
9k views

Granular access to directories within monorepo

I've been reading about the advantages of monorepos, but haven't yet found a mitigation for the problem of sharing parts of a repo: Let's say an organization has a monorepo for a client/server web ...
Dan Dascalescu's user avatar
19 votes
1 answer
3k views

How can I maintain an automatic changelog per module in a monorepo?

I'm working on a project which consists of multiple git repositories. There are multiple microservices, a frontend, some npm-packages and gateway containers, etc. As I often run into the problem that ...
Chop Suey's user avatar
  • 250
10 votes
1 answer
6k views

How to migrate multiple repositories into a mono-repo while maintaining commit history?

I'm trying to migrate a few Git repositories into one monorepo. I have two project repositories, let's call them project1 and project2. In my monorepo, I want to have a projects directory with two ...
Joe Attardi's user avatar
  • 4,501
9 votes
3 answers
4k views

GitOps - Config in same repo or seperate repo?

Firstly this is in the context of a mono-repo application that runs inside Kubernetes. In GitOps my understanding is everything is declarative and written in configuration files such as YAML. This ...
AndrewMcLagan's user avatar
9 votes
1 answer
709 views

How to set Docker Compose `env_file` relative to `.yml` file when multiple `--file` option is used?

I am trying to set my env_file configuration to be relative to each of the multiple docker-compose.yml file locations instead of relative to the first docker-compose.yml. The documentation (https://...
Zhao Li's user avatar
  • 5,456
7 votes
3 answers
3k views

creating a monorepo without hosting on a package registry and installing via bitbucket

At my organization, we are trying to create a monorepo of react components so they can be used on several sites. We currently have a repo called react-components hosted on bitbucket and we wanted to ...
James Daly's user avatar
  • 1,386
7 votes
1 answer
2k views

Limiting uses' access in a monorepo

If you're working on a large monorepo, and you wanna limit some users' access to specific directories (packages) in that monorepo, is there a better way to do this than using git submodules? For ...
Amr Elsekilly's user avatar
7 votes
1 answer
4k views

Git Subtrees vs Monorepo

We recently decided to move from TFVC to Git and I'm trying to find the best way to design our new Git architecture. Our code is made of independent but tightly coupled modules, let's look at the ...
Michael's user avatar
  • 796
7 votes
2 answers
5k views

Trigger pipeline build from sub directory in a monorepo

We're interested in moving a monorepo to git and would like to integrate it with a pipeline based CI/CD. The general pattern we've seen so far is a single pipeline description file at the root of the ...
J Dunbar's user avatar
7 votes
1 answer
1k views

Install Python package from monorepo

We have a private git monorepo which hosts a number of Python packages. Poetry was the dependency management tool initially chosen for the project. Anyway, due to this Poetry issue, it would not be ...
hblanco's user avatar
  • 126
6 votes
2 answers
656 views

Git worktree performance impact

I've just learned about the git worktree feature. It seems to fit my use-case well: I'm used to having a separate repo clone to do side tasks on. I'm working in a big monorepo with lots of frequent ...
Klas Mellbourn's user avatar
6 votes
0 answers
803 views

How to do group permissions in a Monorepo on Github

So we moving over to a monorepo structure and I'm left with the problem of how to restrict access to individual components within the repo on a team by team basis. There isn't a feature on github(yet) ...
CoderWhoSaysNie's user avatar
5 votes
0 answers
2k views

Correct turborepo filter to get "affected" workspaces on push to main

Whenever a pull request is merged to main branch, i want to run turborepo run build command only on the affected workspaces. With nx.dev, i just use the ${{ github.event.before }} SHA to set as base ...
jebbie's user avatar
  • 1,447
4 votes
1 answer
8k views

NX monorepo fatal: No such ref: 'main~1'

I'm trying to build my nx application in github actions with nx cloud enabled. I always get the fatal: No such ref: 'main~1' error. The command nx affected --target=build --base=main~1 --head=HEAD --...
Clement's user avatar
  • 4,710
4 votes
1 answer
7k views

How to use yarn add/npm install with monorepos

I need to download a node package from a private monorepo in GitHub, similar to this: monorepoProject --- subProjectA --- subProjectB And both subProjectA and subProjectB are typescript projects, ...
Marcos Paulo Júnior's user avatar
4 votes
1 answer
2k views

Build Monorepo in VSTS only when package changed

When using a monorepo in VSTS, sometimes I only update one package in a commit, not everything. In that case, I only want to run the build for that particular piece and nothing else. I'm using ...
Kevin Ghadyani's user avatar
4 votes
1 answer
332 views

Integrating Python monorepo application into Yocto

A little context before the actual questions. As a project that I have worked on grew, the number of repositories used for the application we're developing grew as well. To the point that it's gotten ...
staroselskii's user avatar
4 votes
1 answer
646 views

What is the best strategy for building microservices in a mono repo?

I have a mono repo (git) which houses multiple microservices that I am working on. On push, the 3rd party build service detects this push and starts processing the build and deployment. This works ...
tensai's user avatar
  • 1,696
4 votes
0 answers
701 views

How do I target a subdirectory of a (Lerna) monorepo when targeting installation of an NPM package by branch?

Sometimes, it's useful to target a git branch (as in Depend on a branch or tag using a git URL in a package.json? ), with e.g.: "dependencies": { "@my-company-internal-scope/some-...
merkworku's user avatar
4 votes
1 answer
978 views

Lerna Monorepo keeping individual git repos as packages

In lerna, one can initialize git at the root level of the lerna project and inside the packages folder, we keep our small individual projects. Now suppose, you want to keep the git histories and ...
Param Singh's user avatar
  • 1,365
4 votes
0 answers
84 views

Depend on workspace package from a branch in a package.json?

Let's say in my package.json I depend on a next branch by declaring in my dependencies: react-admin": "marmelab/react-admin#next" That repository has workspaces (local packages so to say). For ...
Christiaan Westerbeek's user avatar
3 votes
2 answers
3k views

How to fork part of a monorepo and still be able to merge upstream commits?

Sometimes I find monorepo on GitHub that consists of multiple npm packages, which I would like to make some modification and use it in my projects. But it's much harder for npm to install package from ...
zypA13510's user avatar
  • 1,243
3 votes
2 answers
1k views

Git commits that touch a subtree/subfolder

I have a monorepo project proj using subtrees in a folder sub under proj/sub. I have made tons of commits that touch both proj and sub. How do I publish the relevant changes to upstream sub ...
rfabbri's user avatar
  • 246
3 votes
2 answers
2k views

How to merge git repositories in subfolders without losing branches and tags?

While this question would seem to be a duplicate or many previous ones (and tens of blog posts dealing with similar subject), I need to make you aware that I am looking for an approach that would ...
sorin's user avatar
  • 167k
3 votes
1 answer
359 views

Time and space complexity of git commands

Before switching to a monorepo, I need to foresee what the consequences will be. An important thing to consider is the behavior of git when dealing with huge repositories. Questions such as: How much ...
Özgür Murat Sağdıçoğlu's user avatar
3 votes
1 answer
3k views

Monorepo for ASP.NET Core Web API micro services

I am wondering if monorepo is the best solution for creating a micro services based project? Is there any better solution than making loosely coupled services and then push them into one repo? Is ...
Dark Storm's user avatar
3 votes
1 answer
459 views

ci/cd independent microservices in monorepo with git bash

Using Bash and git, how do I get a collection of directories containing files that differ from that last time the branch was merged into master? Even better would be a collection of changed that ...
Tom's user avatar
  • 1,211
3 votes
1 answer
2k views

Is there a way to push a git tag using lerna without bumping up any version?

Is there a way to push a git tag using lerna without bumping up any version/without pushing any commit? I want to run a command from my CI machine where it tags a particular commit with a static ...
Shridhar Kalagi's user avatar
3 votes
1 answer
1k views

Merge two git repositories with history into subdirs and pretend the files where always there

I need to merge two git repositories into one new repository without losing the history and preserve the feature branches and tags. This seems like a pretty common question which already has been ...
22dc's user avatar
  • 31
3 votes
1 answer
347 views

How do I deal with committing to multiple branches during development?

I'm looking for uptodate knowledge/best practice/advice. We are considering moving to a mono-repo for our development. We use Scrum with Stories/Epics/Sprints (I'm not fully uptodate on all the ...
Richard A Quadling's user avatar
3 votes
0 answers
730 views

GIT Versioning strategy for a monorepo that has different set of framework libraries

I am analyzing the monorepo strategy for some of my framework node modules / libraries that are currently part of different repos. I have around two dozen node modules / libraries and not all of them ...
vinoth's user avatar
  • 51
3 votes
2 answers
3k views

Gitlab CI and Git partial clone

I am testing the git partial clone feature on a large monorepo. A developer might run the following commands on his machine: git clone --filter=blob:none --sparse THE_MONOREPO_URL.git git sparse-...
Touloudou's user avatar
  • 2,143
2 votes
1 answer
6k views

Husky hooks not running in Lerna monorepo

I am working on a MonoRepo and one of the last things I am trying to automate is all my linting/formatting on code commits. Currently I have most of my config in the root folder and I am extending ...
Jason McFarlane's user avatar
2 votes
1 answer
345 views

How to import packages in monorepo within Go service?

I have a monorepo. Let's say it's github.com/myself/monorepo. I have two services in it: service-one and service-two. Each has a go.mod file. In service-one I have a type to import: package service-...
Yura's user avatar
  • 1,174
2 votes
1 answer
611 views

Git and sparse-checkout on large monorepos - hiding irrelevant changes for a sparse-checkout specification? (git-diff, git-log, etc)

As git is increasingly advertised (and enhanced) to better support very large repositories (so-called "monorepos"), with major recent enhancements to the sparse-checkout workflow (git-sparse-...
Tao's user avatar
  • 13.8k
2 votes
2 answers
235 views

Is there any way to NOT ignore .git in subfolders?

I've got a project sort of like this: + MonoRepo - .git + PublicUtil - .git - PublicFile.js + PrivateStuff - internalUseOfPublicUtil.js With this structure we can have updates ...
Seph Reed's user avatar
  • 10.1k
2 votes
1 answer
364 views

How can I push a nx monorepo project to a remote branch?

I'm need to push a react nx monorepo project to a remote development branch. To do that, I've cloned the repo, created my nx monorepo project and called it "core" . After that, I did "...
Amauri Santos's user avatar
2 votes
2 answers
681 views

What can I do to deploy only changed microservices if I keep all of them in one git monorepo?

So, I have one git monorepo and several microservices inside it. Each microservice is a gradle module with Java/Kotlin code - a submodule of the root gradle project. I'm wondering how to configure CI/...
KMV's user avatar
  • 61
2 votes
1 answer
71 views

Git: fastest way to move several files from different directories to new repository

I'm working on splitting one big monolith application into several microservices in monorepo. Monolith is in a big Git repository with commit history as far as 2010. For each new microservice, I ...
nass's user avatar
  • 347
2 votes
2 answers
477 views

Create a new repository from existing of a subdirectory with only relevant files and commits

I have a monorepo with many different packages in it. I'd like to take a package and create a new repo for it. I would like to preserve commits pertaining to the files within the project folder. I've ...
ThomasReggi's user avatar
  • 58.1k
1 vote
1 answer
1k views

Why does unrelated history appear when running a "git log -m --follow" on a file after merging in multiple repos into one monolithic repository?

I have several distinct git repos that I'd like to merge together into one monolithic repo while retaining their histories. I've found a way to do this but I am a little confused about what git log ...
Nida's user avatar
  • 21
1 vote
2 answers
879 views

What is the monorepo work flow? Every time I update the common components lib, I have to update other place where has it dependency. Is this normal?

Case steps: I have packages/common packages/react-A these 2 sub projects inside packages react-A has a dependency [email protected] I upgraded common from v1.0.0 to v2.0.0, and did a lot of change. The ...
Yoki Yu's user avatar
  • 57
1 vote
1 answer
520 views

Git monorepo layout with shared library

We have two projects A and B with shared library L. To avoid duplication of L' s history, we are considering to set up a Git monorepo which will contain A, B and L on the top-level: / +-- L | +-- ...
mstrap's user avatar
  • 17.3k
1 vote
0 answers
425 views

nrwl/nx-set-shas not getting previous successful commit

I'm currently encountering an issue while using nx-set-shas in my project. According to my understanding, nx_base should capture the last successful commit of the remote feature branch in CircleCI, ...
Ruby Lai's user avatar
1 vote
0 answers
376 views

From multirepo with multiple branches to monorepo

We am trying to move from multirepo to monorepo. In addition to move several repositories to one repository, we have several branches on each of the repositories. At least we have updated all the ...
Rodrigo Sedano's user avatar
1 vote
0 answers
641 views

How to move GIT repository content to Monorepo repository with preserving commit history and branches?

I'm about to move my Next.js project repository to Turborepo, for visualization this is the folder structure: root ├── app/ │ └── my-app ├── packages/ │ ├── ui │ └── hooks ├── node-modules ├─...
Nightcrawler's user avatar
  • 1,061
1 vote
0 answers
420 views

Moving 2 git repositories into packages folder on monorepo perserving git history

I'm creating a monorepo that will include 2 current separate repositories. Let's just call then repo1 & repo2 However, I'm not 100% sure how to preserve the git histories of both correctly. Both ...
mcclosa's user avatar
  • 1,285
1 vote
0 answers
457 views

Configure git to always fetch only current branch and master

Is it possible to configure git to, by default, when using git fetch, fetch only the current branch and master from the remote, without explicitly mentioning the current branch name? I know that I can ...
Klas Mellbourn's user avatar
1 vote
0 answers
364 views

Git Refs error when running build in CI/CD pipeline (AWS CodeBuild)

I have configured a CI/CD pipeline in AWS CodeBuild with a GitHub monorepo as source. When I merge a branch into master it triggers a build. The build, configured in yaml file, has subsequent git ...
JourneyToJsDude's user avatar
1 vote
0 answers
787 views

How to create test branches and release branches in mono repo project with independent versioning using Lerna

I have a mono repo project in javascript(Vue) with independent versioning using the Lerna tool. When I want to publish these packages to NPM, I have used lerna publish command. But if I want to ...
Jithin Vijayan's user avatar