Rejected master -> master (non-fast-forward)

In this article let’s discuss about Rejected master -> master (non-fast-forward). Let’s go through the following methods without any delay.

Method 1:

# if you updated your files on so may be thats its asking first pull
# request then your push the request.
# so Very simple first:
# not use -f 
git pull origin master
# then
git push origin master

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!

Method 2 :

git push -f origin master !!This is never a recommended use of git. This will overwrite changes on the remote. Only do this if you know 100% that your local changes should be pushed to the remote master.

Hope the above solution works.

Realted Posts : Git remove cached