git提交的错误
今天学习python,之后想把学习时的代码推送的远程上,出来一些错误,想在想把这些问题记录下来
$ git push -u origin master
我首先提交,然后报错如下
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
后来就寻找问题,竟然发现我之前与远程库关联出错了(单词拼错了。。。。。晕)
之后从新关联
$ git remote add origin git@git.oschina.net:hu/python.git
再提交
$ git push -u origin master
然后又有报错
error: failed to push some refs to 'git@git.oschina.net:huangen/python.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
之后上网百度,上面说要让远程与本地同步
于是乎 输入命令
$ git pull --rebase origin master
又有报错
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
现在,我发现运来本地有更改
于是,我就从新来过
git add .idea/
$ git commit -m "python"
$ git pull --rebase origin master
$ git push -u origin master
之后就成功了