I try to checkout a remote branch.
And then make a commit and then push.
I get fatal: No destination configured to push to
error when I do a 'git push'.
Here is the sequence of commands I use:
$ git checkout remote/test-1.6
$ git checkout -b test-1.6
$ git commit -a -m "commit message"
$ git push
fatal: No destination configured to push to.
Thank you.
It may be possible that push permission is not provided to the user pushing the code changes. I suggest checking the user permissions. If the push permission is present, then it may be possible that there is a pre-push git hook in the repo and your push isn't in accordance with it.
To force a push to only one branch, use a + in front of the refspec to push (e.g git push origin +master to force a push to the master branch). See the <refspec>... section above for details. Force an update only if the tip of the remote-tracking ref has been integrated locally.
To push a branch on remote, your branch needs to have the latest changes present in remote repository. If you get the failed to push error, first do git pull the branch to get the latest commits and then push it.
You probably already have a remote for your repository, but your new branch hasn't been configured to use it. This should work:
git push --set-upstream remote test-1.6
Having done that once, there is now a tracking branch in place and you can simply use "git push" in future -- assuming you've configured upstream push of the current branch as the default, like so:
git config --global push.default tracking
Or (preferred) as of git 1.7.4:
git config --global push.default upstream
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