Method to override the .git folder
homer6
PROOP

7 months 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 8 months ago


homer6
PROOP

7 months ago

Excellent. Thank you for the workaround.


Status changed to Awaiting Railway Response Railway 7 months ago


Status changed to Solved brody 7 months ago


Loading...