Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Create new remote git repo

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

After I executed this command, it created a new branch branch_1 on the Git Hub.

>Solution :

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_1and set up your local branch_1 to track it.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading