Problem Description:
[rejected] master, Master (Non-fast-forward) error:failed to push some refs to ' git@github
when you upload the code, you can upload a good, but suddenly this appears as a problem. Now let me show you how to solve the simple and easy-to-operate scenario:
First step: Find the source of the error
(1) Open the Git Gui (the visual interface of Git) as shown below and click on the merge that the icon points to.
Click on the local merge inside
(2) A dialog will pop up at this time, as shown below: Follow the icon to indicate the operation
(3) After completing the above two clicks, the following image will appear, in the non-cached changes listed in the file must be removed.
Step Two: Remove Files
(1) Right-click on the git Bash (git command Window) in the local repository and use git rm-r file name (mentioned above to delete files). For example, there are two non-cached folders Day01 and day02, the Delete command for git rm-r day01 Click Enter, then type git rm-r day02 and return. This way, the files that are not cached are deleted.
after doing the above, you can test the upload, git push, you can succeed
here also has an article, is writes the upload cannot succeed, encounters the question, recommends to everybody to look
Links: http://blog.csdn.net/chain2012/article/details/7476493