Git Branches

Command snippets to create, switch, and merge git branches

// shorthand for creating and switching to new branch
git checkout -b BranchName

// create new branch
git branch BranchName

// switch to new branch
git checkout BranchName

// check current branch
git branch

// merge current branch with another branch
git merge BranchName

// push merged branch
git push origin BranchName

// delete branch locally
git branch -d BranchName

// delete branch remotely
git push origin --delete BranchName

If you enjoyed this post please share, and follow me on and Twitter if you would like to know as soon as I publish a post! 🔥