'git push a sub branch
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://[email protected]/uname/project.git'
Solution 1:[1]
git push origin feature_swap_experiment
should be the right command. Is there any chance that your remote is not set up correctly?
- if you check master back out, can you push to the remote?
- 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://[email protected]/uname/project.git HEAD:feature_swap_experiment
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Community |
