Create new remote git repo [duplicate]
I`m very confuse about git basics. I have a local branch "develop" and I created a new local branch "branch_1" from "develop" using command: git checkout -b branch_1.
I need to create a remote branch "branch_1" on GitHub and connect my local branch "branch_1" to it, but I`m not sure what is the proper way to do it. Since "branch_1" is not exist yet on GitHub, how I can create it from terminal? In my previous attempt, I created a new branch using GitHub website and ended up with an orphan branch. Can anyone provide me with the next step, please?
I used git push and got: The current branch branch_1 has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin branch_1
After I executed this command, it created a new branch branch_1 on the Git Hub.
Without needing to create any new branches directly on GitHub, you should be able to run
git push -u origin branch_1
(or whatever your remote name is instead of origin). This will automatically create the new remote branch branch_1
and set up your local branch_1
to track it.