-
-
Save denitram/6383978 to your computer and use it in GitHub Desktop.
Git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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