From 3d6c00dded3ca11f0759adb0439d949968e022dc Mon Sep 17 00:00:00 2001 From: abdel ali <35116901+a6delali@users.noreply.github.com> Date: Thu, 6 Dec 2018 19:12:13 +0000 Subject: [PATCH] Git shortcuts (#261) * I committed and pushed a merge that shouldn't have happened * git shortcuts * remove extra commands in git shortcut section --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index f934fe3..438b1be 100644 --- a/README.md +++ b/README.md @@ -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)). + +## 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