I'm learning how to use git and I need to clone from a master github repo, branch it, make changes, and push the branch to the github repo - but I'm finding myself a bit confused on what the best way to do that would be. I know there are so many resources on git online but I can't find one that is this exact problem (although happy to use that if I'm wrong).
I've been testing on my own private github repo to see the differences and there doesn't seem to be any.
- clone from repo.
git clone git@github.com:organization/repo
- create a new branch
git checkout -b newbranch
- make changes, add, and commit
touch file
git add file
git commit -m "added file"
- when I try to push there is no upstream
git push
I get an error saying "fatal: The current branch newbranch has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin newbranch
but I also see a lot of online tutorials using
git push -u origin newbranch
Is there any functional difference between this? I'm sure there is some resource online about the difference, but git is a bit confusing to me and I though i'd ask this one direct question to see what people thought.