April 2021
1 min
Working with git can be overwhelming. Here are some easy commands to make it better while working with branches.
To create a new branch, run git branch new-branch
. This will create a new branch copying the the current branch (all history included).
First, we need to go to the master branch as you need to be in the branch you want to merge to. Use git checkout master
to change the active branch back to master.
Then git merge new-branch
to merge the new branch into the master branch (where you are currently).
Local
git branch -d branchNameInLocal
Remote
git push origin --delete branchNameInRemote