Android studio checkout as new local branch
To checkout a new local branch in Android Studio, you can follow these steps:
- Open your project in Android Studio.
- Click on the "VCS" (Version Control System) menu in the top menu bar.
- Select "Git" from the dropdown menu.
- Click on "Branches" from the Git menu.
- Click on the "New Branch" button.
- In the "Create Branch" dialog box, enter a name for your new branch (e.g. "feature/new-login-screen").
- Select the branch you want to create from the "Checkout" dropdown menu (e.g. "master").
- 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.