Android studio checkout as new local branch

To checkout a new local branch in Android Studio, you can follow these steps:

  1. Open your project in Android Studio.
  2. Click on the "VCS" (Version Control System) menu in the top menu bar.
  3. Select "Git" from the dropdown menu.
  4. Click on "Branches" from the Git menu.
  5. Click on the "New Branch" button.
  6. In the "Create Branch" dialog box, enter a name for your new branch (e.g. "feature/new-login-screen").
  7. Select the branch you want to create from the "Checkout" dropdown menu (e.g. "master").
  8. Click "Create Branch" to create the new branch.

Alternatively, you can also use the command line to create a new local branch. To do this, open a terminal or command prompt and navigate to your project directory. Then, run the following command:

git branch <branch-name>

Replace <branch-name> with the name you want to give your new branch (e.g. "feature/new-login-screen").

Once you've created the new branch, you can switch to it by running the following command:

git checkout <branch-name>

This will switch your local repository to the new branch.

Note: If you want to create a new branch from a specific commit, you can use the following command:

git branch <branch-name> <commit-hash>

Replace <branch-name> with the name you want to give your new branch, and <commit-hash> with the hash of the commit you want to base your new branch on.