$ git reset HEAD~1
$ git push origin +HEAD
# reset local branch to desired commit hash
$ git checkout [local-branch-name]
$ git reset --hard abc123d4e5
# now, reset remote branch to desired commit hash
$ git push -f [remote-name] 0d1d7fc32e5a947fbd92ee598033d85bfc445a50:[remote-branch-name]
$ git log --oneline --decorate
$ git status -sb
$ git config --global branch.autosetuprebase always
$ git add -p # patch check all adds
$ git push -d <remote_name> <branch_name>
$ git branch -d <branch_name>
$ # Add a tag
$ git tag vx.x.x HASHNUM -am ‘description.’
$ git push --tags
$ # Delete a tag
$ git tag -d 12345
$ git push origin :refs/tags/12345
also https://mislav.net/2010/07/git-tips/
- [First, fork in GitHub]
$ git clone MYREPO
$ cd MYREPO
$ git remote add upstream THEIRREPO
$ git remote set-url --push upstream no_push
$ git remote -v
$ git fetch upstream BRANCH
$ git rebase upstream/BRANCH
$ git push
$ git checkout -b newbranch
$ git push -u origin newbranch
$ git checkout oldbranch
$ git reset --hard HEAD~1
$ git push origin +master
$ git flow init -d
$ git flow feature start AB-nnnn/featurename
$ git flow feature publish AB-nnnn/featurename
$ git checkout master
$ git merge --squash changebranch
$ git commit -m 'Squashed feature.'
$ git push
$ git branch -D changebranch
$ git push origin :changebranch