Created
September 14, 2019 22:58
-
-
Save ludndev/4de72625c1ab4a538b0a8451ef27380f to your computer and use it in GitHub Desktop.
Useful Git Command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**Create a Branch** | |
git branch branch-name | |
**Checkout a Branch** | |
( _git checkout command switch branches or restore working tree files_ ) | |
git checkout branchname | |
**Renaming a Branch** | |
git branch -m branch-old-name branch-new-name | |
**Delete a Branch** | |
git branch -d branch-to-delete | |
git branch -D branch-to-delete ( *force deletion without checking the merged status* ) | |
**Create and Switch Branch** | |
git checkout -b branchname | |
**List all branches** | |
git branch ( *local only* ) | |
git branch -r ( *remote only* ) | |
git branch -a ( *remote and local* ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment