I have a need, via automation, to create a new branch on the git remote, but I need to do this without the overhead of first getting a local copy of potentially large repos.
Unless I'm missing something (obvious or subtle), every example I find presumes I want to 'fetch', 'clone' or 'checkout' the repo locally, then make a branch, then push to the origin.
This isn't what I want to do. I need, from a script that's running on a ubuntu server where I cannot afford the overhead of cloning repos, to simply add a branch to the remote, so others can then pull down that branch and start working.
The use case is, I'm working with an automation framework where we are enforcing best practices by creating feature branches before developers begin working.
Using GitHub or GitLab this is easy via the API. In some cases where my customers are simply using 'git', I have to do this using the command line and scripting.
I know this may be ambiguous, so please let me know if the question isn't clear.
--depth=1to theclonecommand plus tell it to only fetch the branch you want to stand on when pushing your new branch to get minimal history downloaded.git branchcommand?