Branching

  1. Branch

git branch

The git branch command allows you to create, list, rename and delete branches.

  • Create Branch

git branch branchName
Ex: git branch Demo
  • List Branch

git branch or git branch --list
  • Delete Branch

git branch -d branchName
Ex: git branch -d Demo
  • Rename Branch

git branch -m branchName
Ex: git branch -m Demo1
  • Delete Remote Branch

git push origin --delete branchName 
Ex: git push origin --delete Demo
  1. Checkout

git checkout

You can switch between two branches with the git checkout command.

  • Create and switch Branch

  • Discord changes

  1. Merge

You can merge two branches with the help of git merge command.

  • Merge into other branch

  1. Cherry-pick

Cherry-picking in Git stands for applying some commit from one branch into another branch.

  1. Rebase

Rebasing is a process to re apply commits on top of another base commit.

  • Continue to apply changes

  • Skip changes and apply

  1. Stash

Switch branches without committing the current branch.

  • Save Stash

  • List Stash

  • Apply Stash

  • Show Changes

Last updated