S A
S A

Reputation: 825

Android Studio Why Branch

I am new to use git and don't understand the purpose of branching.

Correct me if i'm wrong, branching is used to working on your project which allows you to have different clones that allows you to work on multiple things then allowing to merge them into the main branch.

For example making a branch to get the location API working while in a different branch you are working on the camera API.

From what I have experienced I can only work on one branch at a time, doesn't let me go the main branch unless I delete the new branch. I am also having issue merging in android studio but I can do it in bitbucket.

I hope someone could share some light onto this.

Upvotes: 0

Views: 54

Answers (1)

kcraigie
kcraigie

Reputation: 1262

To return to the main branch or go to a different branch without deleting the branch you're working on, simply:

git checkout master (or whatever branch)

Edit: As @t0mm13b commented, git won't let you leave a branch that has uncommitted changes so you'd have to either commit your changes before switching branches or use git stash

Upvotes: 2

Related Questions