1

I was in branch feature_swap there I did some change but I am not confident enough to push those changes in feature_swap branch. So I tried to create another sub branch feature_swap_experiment with

git branch feature_swap_experiment
git checkout feature_swap_experiment

Now I want to push to feature_swap_experiment I've tried
git push origin feature_swap_experiment which is not working

error: src refspec feature_swap_experiment does not match any.
error: failed to push some refs to 'https://uname@bitbucket.org/uname/project.git'
Dipro Sen
  • 4,350
  • 13
  • 37
  • 50

1 Answers1

0
git push origin feature_swap_experiment

should be the right command. Is there any chance that your remote is not set up correctly?

  1. if you check master back out, can you push to the remote?
  2. Do the contents of your .git/config file look correct? Especially check the [remote "origin"] section of the file.

Also, git branch -a should give you a list of all branches, local and remote, so you should be able to quickly see if things are set up correctly.

This may help: How do you create a remote Git branch?

Edit: After looking at the error message you added to the question, it seems like you might have the same problem as described here: Error when "git push" to github

So in your case, you would run:

git push https://uname@bitbucket.org/uname/project.git  HEAD:feature_swap_experiment
Community
  • 1
  • 1
Dmitri
  • 2,658
  • 2
  • 25
  • 41