Git Branching
Check all locally available branches
Make a new branch & Switch to new branch
You can do the above 2 steps in a single line
Delete a branch
Delete a branch locally and remotely
Locally
Two options to delete a local branch
Option 1:
Option 2:
If you get run into an error such as the following
error: The branch 'feature' is not fully merged. If you are sure you want to delete it, run 'git branch -D feature'.
then do
Please note, the above command will discard all the unmerged changes
Remotely
To delete remote branch
Merging two branches:
View local and remote branches
To view all local and remote branches
To view only remote branches
Pull remote branches to local repo
Let's say we have "dev2" branch on our remote repo, but not locally. We can pull this branch locally and start working on it
Set up default branch as main/master
Last updated