Git Branch Commands
git branch
git branch //To list all branches in the repository
git branch <branch-name> //To create a new branch
git checkout <branch-name>//To switch to a different branch
git checkout -b <branch-name> //To create and switch to a new branch at the same time
git branch -m <old-branch-name> <new-branch-name> //To rename a branch
git branch -d <branch-name> //To delete a branchgit diff
git diff <commit1>..<commit2> //to see the diff between two commits
git diff <branch1>..<branch2> //to see the diff between two branchesgit show
Last updated