Git: Delete a branch (local or remote)
To delete a local branch
git branch -d the_local_branch
To remove a remote branch (if you know what you are doing!)
git push origin --delete the_remote_branch
Sync
git fetch -p
The git manual says -p, –prune After fetching, remove any remote-tracking branches which no longer exist on the remote.
Git merge branch to master
Unsafe way
git checkout master git pull origin master git merge test git push origin master
SAfe way – see conflicts
git checkout test git pull git checkout master git pull git merge --no-ff --no-commit test
Git revert to commit
git log
See commit named(example) 4cf9bb9653bf5fb13c24c423e0d3ea81348e4c7c
git revert --no-commit 4cf9bb9653bf5fb13c24c423e0d3ea81348e4c7c HEAD git commit
And push
git push