关于在git使用中出现的问题

问题一:   

     error: failed to push some refs to 'https://github.com/Ed-song/develop-example001.git'

   

$ git push -u origin master
Username for 'https://github.com': Ed-song
To https://github.com/Ed-song/develop-example001.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/Ed-song/develop-example001.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.

主要原因: github中的README.md文件不在本地代码目录中

解决办法:

                可以通过如下命令进行代码合并【注:pull=fetch+merge]

                git pull --rebase origin master

                

问题二:      

          git does not appear to be a git repository

     解决办法:   删除初始远程地址                

                     $ git remote rm origin

  

不积小流,无以成江河!记住一万个小时定律!
原文地址:https://www.cnblogs.com/Ed-song/p/7986940.html