Creating new branch on github
To create a new branch on GitHub, you can follow these steps:
Using the GitHub Web Interface:
- Log in to your GitHub account and navigate to your repository.
- Click on the "Branches" tab.
- Click the "New branch" button.
- Enter a name for your new branch in the "Branch name" field.
- Optionally, you can also enter a description for your branch.
- Click the "Create branch" button.
Using the Command Line:
- Open your terminal or command prompt.
- Navigate to your local repository using the
cd
command. - 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):
- Open Git Bash.
- Navigate to your local repository using the
cd
command. - 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:
- Once you've created the new branch locally, you'll need to push it to GitHub.
- 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:
- 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 on GitHub.