** 情形:**在本地分支local_branch修改了代码,之后要提交到远程分支remote_branch上,使用命令git push origin remote_branch报错。
** 报错:**
error: src refspec remote_branch does not match any
error: failed to push some refs to ‘http://****.git’
** 解决方案:**
git push origin local_branch:remote_branch
推送本地分支local_branch到远程分支 remote_branch并建立关联关系
a.远程已有remote_branch分支并且已经关联本地分支local_branch且本地已经切换到local_branchgit pushb.远程已有remote_branch分支但未关联本地分支local_branch且本地已经切换到local_branchgit push -u origin/remote_branchc.远程没有remote_branch分支并,本地已经切换到local_branchgit push origin local_branch:remote_branch