We have a new repository created, it is empty right now i want to create new branches and push the latest code there.
I tried git checkout -b branchname, but didn't helped.
And how we can identify, if we have more repositories and where we are creating the branches?
Please provide step by step process, that will be great-full.
Hi Pradeep,
Welcome to the Atlassian Community.
An empty repository cannot have a branch, branches are pointers to commits. So you first have to commit something in the empty repository before the branch can be created. You can either commit the code from the other repository, or just an empty file, create your branch and then commit the code.
Committing something ahead of time would muddy the waters. They should just add the new empty repository as a 2nd remote for their current clone and then push their branch to it.
From the original clone (on their workstation) try something like this:
git remote add fork [url-to-empty-repo]
git push fork HEAD:refs/heads/branchname
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.