# Make a Branch

Every commit belongs to at least one branch. The default branch is typically named `master` or `main`.

### View current branch

To view which branch you're current at, use `git branch`:

```bash
λ git branch
* master
```

This tells that I'm currently on the `master` branch.

### Create a new branch

You can do this in two steps:

* Create a branch: `git branch <name>`
* Change to that branch: `git checkout <name>`

Or do it in just one step: creating then changing to that branch: `git checkout -b <name>`.

```bash
λ git checkout -b new
Switched to a new branch 'new'

λ git branch
  master
* new
```

Here I create a branch called `new`. When calling `git branch` again it shows I'm on branch `new`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yu-sun.gitbook.io/essential-git-for-scientists/basic-operations/make-a-branch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
