Search code examples
gitbitbucketgit-bashgit-pushgit-pull

Git push feature not working in bitbucket


Im newbie in git bitbucket, but I'm confused why the error always comes up like the image I Provided below, I intented to update my feature 13 using git push but it didn't work properly. Is anybody know about this? thanks

enter image description here


Solution

  • You can not push, because there are changes on the server.

    First you should find out what these changes are.

    git fetch origin
    will update the remote branches on your local copy

    git log origin/feature/13 ^feature/13
    will show you the changes that are on the server or use any tool to view the commithistory

    depending on if you need those changes or not, you have to either merge them into your feature branch or overwrite them on the server. (be sure not to overwrite commits other people created or branched from)

    git pull origin feature/13
    will merge those changes with yours

    git push --force-with-lease origin feature/13
    will overwrite the changes on the server