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
?
之后就成功了
轉載于:https://www.cnblogs.com/huanggen/p/6524270.html
總結
- 上一篇: HTML5 SVG
- 下一篇: 计数排序Counting sort