Skip to content

Commit 8e69783

Browse files
twwilliamsRichardLitt
authored andcommitted
Add shortcuts information for Windows PowerShell (k88hudson#263)
1 parent 73547ca commit 8e69783

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

README.md

+24-7
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,13 @@ All commands should work for at least git version 2.13.0. See the [git website](
123123
- [I want to add command line coloring for Git](#i-want-to-add-command-line-coloring-for-git)
124124
- [I've no idea what I did wrong](#ive-no-idea-what-i-did-wrong)
125125
- [Git Shortcuts](#git-shortcuts)
126-
- [Other Resources](#other-resources)
127-
- [Books](#books)
128-
- [Tutorials](#tutorials)
129-
- [Scripts and Tools](#scripts-and-tools)
130-
- [GUI Clients](#gui-clients)
126+
- [Git Bash](#git-bash)
127+
- [PowerShell on Windows](#powershell-on-windows)
128+
- [Other Resources](#other-resources)
129+
- [Books](#books)
130+
- [Tutorials](#tutorials)
131+
- [Scripts and Tools](#scripts-and-tools)
132+
- [GUI Clients](#gui-clients)
131133

132134
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
133135

@@ -1705,6 +1707,8 @@ Using `git reset` it is then possible to change master back to the commit it was
17051707
<a name="git-shortcuts"></a>
17061708
## Git Shortcuts
17071709
1710+
### Git Bash
1711+
17081712
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.
17091713

17101714
```sh
@@ -1713,8 +1717,21 @@ alias sq=squash
17131717
function squash() {
17141718
git rebase -i HEAD~$1
17151719
}
1716-
````
1717-
copy those commands to your .bashrc or .bash_profile.
1720+
```
1721+
1722+
Copy those commands to your .bashrc or .bash_profile.
1723+
1724+
### PowerShell on Windows
1725+
1726+
If you are using PowerShell on Windows, you can also set up aliases and functions. Add these commands to your profile, whose path is defined in the `$profile` variable. Learn more at the [About Profiles](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles) page on the Microsoft documentation site.
1727+
1728+
```powershell
1729+
Set-Alias sq Squash-Commits
1730+
1731+
function Squash-Commits {
1732+
git rebase -i HEAD~$1
1733+
}
1734+
```
17181735

17191736
# Other Resources
17201737

0 commit comments

Comments
 (0)