Local branch: git branch -d <local_branch>
Remote branch: git push origin --delete <remote_branch>
git checkout -b <new_branch_name> <source_branch_name>
git push -u origin <my_branch>
git reflog
git reset HEAD@{N}
*N is target number of commit log to reset to.
git show --summary
git checkout <branch>
git reset --hard <commit-hash>
git push -f origin <branch>
git pull --all
git checkout --track origin/john_branch
where --track
is shorthand for git checkout -b [branch] [remotename]/[branch]
git fetch origin
git reset --hard origin/master
git clean -fd
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
Ref: https://nvie.com/posts/a-successful-git-branching-model/
git checkout -b myfeature develop
git checkout develop
git merge --no-ff myfeature
.
.
.
git branch -d myfeature
git push origin develop