Git
List all your branches:
Create a New Branch
1
| git checkout -b new-branch-name
|
Or, checkout the branch you want to use:
1
| $ git checkout <feature_branch>
|
Confirm you are now working on that branch:
If your local branch already exists on the remote, run this command:
If your local branch does not exist on the remote, run either of these commands:
1
| git push -u origin my-branch-name
|
Merge a Branch
Check working tree is clean and see what branch you’re on
Check out the branch that you want to merge another branch into (changes will be merged into this branch, for example master).
Merge another branch into the current branch:
1
| git merge my-branch-name
|
Delete branch
1
| git branch -d <feature_branch_name>
|
Git: How to Handle Merge Conflicts