Search code examples
androidgitandroid-studiogithubgit-pull

Pulling from Github to Android Studio


I have two branches in a Github repository. I'd like to pull the code from one of the branches and overwrite the code in Android Studio.

What I've tried:

  1. I went to VCS -> Git -> Pull

enter image description here

  1. Click Pull and this is the status after pulling:

enter image description here

Now, when I check the code in Android Studio, it is still the same. Nothing has been updated. What am I missing?


Solution

  • Ok, so I was able to fix this somehow.

    I tried pulling from my terminal (not the one on Android Studio) like this:

    git pull {repo} {remote-branch}:{local-branch}

    and it said something like this: "Non-Fast-Forward rejected!".

    I just added --force at the pull command like so:

    git pull --force {repo} {remote-branch}:{local-branch}

    And it worked.