How to create new github branch

To create a new branch in GitHub, you can follow these steps:

Using the GitHub Web Interface:

  1. Log in to your GitHub account and navigate to your repository.
  2. Click on the "Code" button on the top left corner of the page.
  3. Click on the "New branch" button.
  4. Enter a name for your new branch in the "Branch name" field.
  5. Optionally, you can also enter a description for your branch.
  6. Click on the "Create branch" button.

Using the Command Line:

  1. Open your terminal or command prompt.
  2. Navigate to your local repository using the cd command.
  3. Use the git branch command to create a new branch. For example:
    git branch new-branch-name

    Replace new-branch-name with the name you want to give your new branch.

Using Git Bash (on Windows):

  1. Open Git Bash.
  2. Navigate to your local repository using the cd command.
  3. Use the git branch command to create a new branch. For example:
    git branch new-branch-name

    Replace new-branch-name with the name you want to give your new branch.

Pushing the new branch to GitHub:

  1. Once you've created the new branch locally, you'll need to push it to GitHub.
  2. Use the git push command to push the new branch to GitHub. For example:
    git push origin new-branch-name

    Replace new-branch-name with the name of the branch you created.

Switching to the new branch:

  1. Once you've pushed the new branch to GitHub, you can switch to it using the git checkout command. For example:
    git checkout new-branch-name

    Replace new-branch-name with the name of the branch you created.

That's it! You've now created a new branch in GitHub.