Please note: although I mention BitBucket here, I think this is a git question at heart and can be answered by any experience git user. I only mention BitBucket so that folks are aware that I am not using GitHub and as such, can't solve the problem with GitHub-specific solutions. But again, I think the answer is 100% on the git command-line.
Also, if given the preference between a BitBucket UI-based solution, or a pure git command-line solution, I certainly prefer the latter!
I've got a cart-before-the-horse scenario going on here.
I was asked to create a new project and write some code for it, because at the time the people I'm working with weren't ready for a new repository to be created in their BitBucket workspace. So I got a POC working locally, named my project some-service and now am ready to push that project up to a new BitBucket repository to share with other devs. I would like both a main and develop branch (or whatever is the norm for git/BitBucket these days).
Problem is, they are not willing to give me "Create New Repository" permissions, and so they are insisting that they create the repository and simply give me read/write access to it. So, on BitBucket, they have created a new repository called some-service that contains a README.md and a .gitignore and it has a sole master branch.
Normally on GitHub, I create the repos myself, and they have a main branch, and GitHub provides me with a few commad lines to connect/sync up my existing local repo with the new one on GitHub.
What can I do here, ideally solely from the git command line, so that:
- I am able to either clone this repo, or
git initmy localsome-serviceproject, and "connect them" so that I cangit pushon the command line and push those changes to branches in the remote project on BitBucket; and - I am able to set the code in my local copy as the
mainbranch and push that to BitBucket; and - Create a
developbranch in BitBucket and pull that branch down, so that both locally and on BitBucket, I havemainanddevelop?
Thanks in advance for any and all help here!