How can i merge my "Fix branch" back to "Master branch" from Android Studio?

Yes you can.

  1. First you need to push your code in in your fix1 branch which you already did
  2. Than change your branch to master
  3. Now from top VCS control go to git->pull and select your fix1 branch and than click on pull button

Now it will merge your fix1 code to master branch


In your case simply move back to master branch go back to branches list - press fix1 branch and press "merge into current" - this will merge fix1 into master.

A more general explanation:

First of all, make sure you have committed your changes before the merge.

Let's say you have a branch called A and branch called B and you want to merge B into A, so this is what you need to do:

  1. Make sure you are on branch A, you can see it displayed by pressing right click on your project --> Git -- > Repository --> branches. The current branch name will appear at the bottom of the branches list(Or at the top of the list marked with yellow from the latest Android studio version )

  2. from this branches list pick the branch you want to merge into the current branch and pick "Merge" in this case pick branch B and press merge

  3. If no conflicts are there - you are done. If there are conflicts then you need to resolve them - android has a nice merging tool - however, you can do it easily yourself - the conflicted files will be colored in red - you will see the conflicts areas with both branches - remove the undesired code - after resolving all the conflicts you need to press CTRL+A to add them to the git - and then commit your branch again --> Done.