Skip to content

Instantly share code, notes, and snippets.

@denitram
Last active November 5, 2018 20:59
Show Gist options
  • Save denitram/6383978 to your computer and use it in GitHub Desktop.
Save denitram/6383978 to your computer and use it in GitHub Desktop.
Git
# source: http://www.vogella.com/articles/Git/article.html
# set proxy for git globally
$ git config --global http.proxy http://proxy:8080
# to check the proxy settings
$ git config --get http.proxy
# just in case you need to you can also revoke the proxy settings
$ git config --global --unset http.proxy
# Merge 2 commits together
$ git commit --amend
$ git push --force
# Rebase
$ git rebase -i HEAD~2
$ git push --force
# Delete local branch
$ git branch -d the_local_branch
# Git Tools - Rewriting History
* Changing the Last Commit
$ git commit --amend
# Changing Multiple Commit Messages
|see https://git-scm.com/book/id/v2/Git-Tools-Rewriting-History
|change the last three commit messages of any message in this group
$ git rebase -i HEAD~3
# Returning to an Old Revision
$ git reset --hard 0ad5a7a6
|This will rewind your HEAD branch to the specified version.
|All commits that came after this version are effectively undone;
|your project is exactly as it was at that point in time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment