Search code examples
gitbitbucketgit-push

why git push origin master fails?


I want to push my local project on my bitbucket's repository. But it fails. See:

enter image description here

Does anybody what's wrong?


Solution

  • In git when ever you try to push code to the remote server git using a command names merge-base to find out what is the last commit which was "downloaded" from the server.

    enter image description here

    Once the commit is found git "ask" the server to retrieve the changes and merge them locally to your local branch.

    In your case the server found out that since the last time you have pulled from the server that are more changes which you dont have locally so you have to pull your changes into your local branch.

    git pull

    git pull is an alias for 2 commands, git fetch && git merge. git fetch downalod all your changes to your local git repository and git merge will add them to your local working directory.

    In your case its one of the most simple thing to do in git, you simply have to pull the changes from the server into your local branch.

    Git inform you about it and you simply have to pull the changes.

    enter image description here enter image description here