Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker container: Git remote branches are missing in workspace repository #273

Open
mar-be opened this issue Jun 30, 2022 · 1 comment
Open

Comments

@mar-be
Copy link

mar-be commented Jun 30, 2022

I cannot switch to other branches in the workspace repository of the winery Docker container. It seems that all remote branches except for main are missing.

grafik

There should be the following branches:

Bildschirmfoto 2022-06-30 um 16 54 07

git fetch --all does not help

Workaround

Delete the workspace, manually clone the repository from GitHub, and rename its directory to workspace.

@buehlefs
Copy link

This is because the winery clones the workspace repository as a shallow clone. To get a full git repository use the following commands:

# go into workspace
cd /var/repository/workspace

# fetch misssing history
git fetch --unshallow

# fetch missing branch information
git remote set-branches origin '*'

# alternative command to fetch branch information:
# git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"

# fetch branches
git fetch -v

# then switch branch
git checkout branch_name

(taken from https://rotadev.com/how-to-convert-a-git-shallow-clone-to-a-full-clone-dev/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants