git branch's Examples

This command lists all the branches available in the repository.

git branch

This command creates a new branch.

git branch [branch name]

This command deletes the feature branch.

git branch -d [branch name]

This command creates a new branch and also switches to it.

git checkout -b [branch name]

This command used to Rename the current branch to another branch name.

git branch -m main

Lists all branches in the current local repository

$ git branch

Creates a new branch

$ git branch [branch-name]

Deletes the specified branch

$ git branch -d [branch-name]

Deletes the file from the working directory and the staging area

$ git rm [file]

DevOpsSchool
Typically replies within an hour

DevOpsSchool
Hi there 👋

How can I help you?
×
Chat with Us