Git shortcuts (#261)

* I committed and pushed a merge that shouldn't have happened

* git shortcuts

* remove extra commands in git shortcut section
This commit is contained in:
abdel ali 2018-12-06 19:12:13 +00:00 committed by Richard Littauer
parent 8b09e3fb58
commit 3d6c00dded
1 changed files with 15 additions and 0 deletions

View File

@ -122,6 +122,7 @@ All commands should work for at least git version 2.13.0. See the [git website](
- [I want to set a global user](#i-want-to-set-a-global-user)
- [I want to add command line coloring for Git](#i-want-to-add-command-line-coloring-for-git)
- [I've no idea what I did wrong](#ive-no-idea-what-i-did-wrong)
- [Git Shortcuts](#git-shortcuts)
- [Other Resources](#other-resources)
- [Books](#books)
- [Tutorials](#tutorials)
@ -1701,6 +1702,20 @@ Using `git reset` it is then possible to change master back to the commit it was
(copied and edited from [Source](https://www.atlassian.com/git/tutorials/rewriting-history/git-reflog)).
<a name="git-shortcuts"></a>
## Git Shortcuts
Once you're comfortable with what the above commands are doing, you might want to create some shortcuts for Git Bash. This allows you to work a lot faster by doing complex tasks in really short commands.
```sh
alias sq=squash
function squash() {
git rebase -i HEAD~$1
}
````
copy those commands to your .bashrc or .bash_profile.
# Other Resources
## Books