Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
add a new branch to github
mnelson:myproject mnelson$ git push origin my-new-branch
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 313 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/cubeton/mynewrepository.git
 * [new branch]      my-new-branch -> my-new-branch
@francisbarton

This comment has been minimized.

Show comment Hide comment
@francisbarton

francisbarton Apr 6, 2018

Hi, I came here from https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners

I'm sorry but I am rather confused. If you've made changes to a branch locally, why wouldn't you just push only your amended branch to github? Why push the master branch first? I don't understand. Or if your new branch is an amended version of someone else's master branch, wouldn't you need to clone their master to your local machine first, not create a brand new folder and push the master? Thank you if you can clarify.

Hi, I came here from https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners

I'm sorry but I am rather confused. If you've made changes to a branch locally, why wouldn't you just push only your amended branch to github? Why push the master branch first? I don't understand. Or if your new branch is an amended version of someone else's master branch, wouldn't you need to clone their master to your local machine first, not create a brand new folder and push the master? Thank you if you can clarify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment