src refspec fix/careers-short-title does not match any

Pretty simple error right? I've been pushing to the same remote branch for a couple weeks now and all of a sudden it is giving me that error. I have verified that the branch still exists in GitHub and is accessible. I can even see it when using git branch -a. I'm using the command: git push origin fix/careers-short-title. I'm about to force push but want to make sure I'm not missing something.
3 Replies
Jochem
Jochem8mo ago
your error cut off
vince
vinceOP8mo ago
No description
vince
vinceOP8mo ago
Oops. That's the bulk of it though:
error: src refspec fix/careers-short-title does not match any
error: failed to push some refs to <remote_git_repo_url>
error: src refspec fix/careers-short-title does not match any
error: failed to push some refs to <remote_git_repo_url>
Huh okay so I figured it out. I had to do: git push origin careers-short-title:fix/careers-short-title Does anyone know why that works but not git push origin fix/careers-short-title? I guess because my local branch isn't fix/careers-short-title but just careers-short-title it didn't work? I'm assuming git push origin <remote> is a shorthand for git push origin local:remote, as long as they have the same branch name?
Want results from more Discord servers?
Add your server