How the problem solved about " Dealing with non-fast-forward errors"
Recently ,I got confused When I use git to push one of my project. The problem is below:
![](https://images2015.cnblogs.com/blog/778580/201611/778580-20161124202028565-1404369671.png)
And I Found the solutions below maybe helpful to someone who meet the problem:
Dealing with non-fast-forward errors
Sometimes, Git can't make your change to a remote repository without losing commits. When this happens, your push is refused.
If another person has pushed to the same branch as you, Git won't be able to push your changes:
![](https://images2015.cnblogs.com/blog/778580/201611/778580-20161124202133471-1124593304.png)
You can fix this by fetching and merging the changes made on the remote branch with the changes that you have made locally:
![](https://images2015.cnblogs.com/blog/778580/201611/778580-20161124202145221-135188718.png)
Or, you can simply use git pull
to perform both commands at once:
![](https://images2015.cnblogs.com/blog/778580/201611/778580-20161124202155237-1422883887.png)
And another way is to force
git push origin master -f