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

How to git subrepo push from SHA instead of a branch #641

Closed
yk7823 opened this issue Nov 19, 2024 · 1 comment
Closed

How to git subrepo push from SHA instead of a branch #641

yk7823 opened this issue Nov 19, 2024 · 1 comment

Comments

@yk7823
Copy link

yk7823 commented Nov 19, 2024

I'm using git subrepo in CI to automate management of satellite repos but I need a way to git subrepo push from a commit SHA instead of a branch in this context. Because I'm not able to checkout a branch in my use case, I get the following error:

"git-subrepo: Must be on a branch to run this command."

Is there a workaround? If not, are there any future plans to support this capability?

@admorgan
Copy link
Collaborator

admorgan commented Feb 9, 2025

The workaround is to create a branch as part of the scripts that do your satellite repo maintenance on your CI. I do the same and my branch name is is the Jenkins job number. The branch doesn't have to reflect anything in relation to either the source or destination it just has to exist due to the complications of how worktrees interact with the commands we are using internally.

There is the potential for refactoring subrepo such that it doesn't require being on a branch, and I would accept patches to accomplish this, but it isn't something I personally desire to take on.

@admorgan admorgan closed this as completed Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants