Method to override the .git folder
homer6
PROOP

a year ago

I understand that the policy is to not clone the .git folder by default.

But, I'd like to use git submodules inside the dockerfile.

How can I override this setting or work around it for this repo?

Solved

2 Replies

Unfortunately, we do not have support for get submodules at this time. Usually the community recommends using GH Actions as a way to set the build context like so:

```

name: "Pull submodule / Push to deploy branch"

on:

push:

branches: - main

jobs:

pull_submodule_and_deploy:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3

with:

submodules: true

- name: Update commit author

run: |

git config user.name 'github-actions[bot]'

git config user.email 'github-actions[bot]@users.noreply.github.com'

- name: Push to deploy branch

run: |

git checkout -b deploy

git rm --cached path/to/your/submodule

git rm .gitmodules

rm -rf path/to/your/submodule/.git

git add path/to/your/submodule

git commit -m "Flatten submodule for Railway deployment"

git push origin deploy -f

```

This should likely get you off the ground.


Status changed to Awaiting User Response Railway 11 months ago


homer6
PROOP

a year ago

Excellent. Thank you for the workaround.


Status changed to Awaiting Railway Response Railway 11 months ago


Status changed to Solved brody 11 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...