I did:
git co upstream/master # To no branch.
<then did a trivial edit on some file...>
git commit -a -m "Trivial edit"
git push origin NewBranch
But got this:
$ git push origin ignore-netbeans-config
error: src refspec ignore-netbeans-config does not match any.
Can I push to a new branch without creating a local one?
In order to push your branch to another remote branch, use the “git push” command and specify the remote name, the name of your local branch as the name of the remote branch.
You will usually push your local branch to a remote branch of the same name—but not always. To push to a branch of a different name, you just need to specify the branch you want to push and the name of the branch you want to push to separated by a colon ( : ).
No, you must make a commit before you can push. What is being pushed is the commit (or commits).
try
git push origin HEAD:refs/heads/ignore-netbeans-config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With