-
Notifications
You must be signed in to change notification settings - Fork 361
Translate A-git-in-other-environments powershell #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
[[_git_powershell]] | ||
=== Git in Powershell | ||
=== Powershell 中的 Git | ||
|
||
(((powershell)))(((tab completion, powershell)))(((shell prompts, powershell))) | ||
(((posh-git))) | ||
The standard command-line terminal on Windows (`cmd.exe`) isn't really capable of a customized Git experience, but if you're using Powershell, you're in luck. | ||
A package called Posh-Git (https://github.com/dahlbyk/posh-git[]) provides powerful tab-completion facilities, as well as an enhanced prompt to help you stay on top of your repository status. It looks like this: | ||
Windows 中的普通命令行终端 (`cmd.exe`) 无法自定义 Git 使用体验,但是如果你正在使用 Powershell 那么你就十分幸运了。 | ||
一个名为 Posh-Git (https://github.com/dahlbyk/posh-git[]) 的扩展包提供了强大的 tab 补全功能, 并针对提示符进行了增强,以帮助你聚焦于你的仓库状态。它看起来像: | ||
|
||
.Powershell with Posh-git. | ||
image::images/posh-git.png[Powershell with Posh-git.] | ||
.附带了 Posh-Git 扩展包的 Powershell。 | ||
image::images/posh-git.png[附带了 Posh-Git 扩展包的 Powershell。] | ||
|
||
If you've installed GitHub for Windows, Posh-Git is included by default, and all you have to do is add these lines to your `profile.ps1` (which is usually located in `C:\Users\<username>\Documents\WindowsPowerShell`): | ||
如果你已经在 Windows 上安装了 GitHub,Posh-Git 会被默认包含进来,你只需要添加以下两行到你的 `profile.ps1` 文件 (文件位于 `C:\Users\<username>\Documents\WindowsPowerShell`): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 会被默认包含进来——也会被安装 |
||
|
||
[source,powershell] | ||
----- | ||
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1") | ||
. $env:github_posh_git\profile.example.ps1 | ||
----- | ||
|
||
If you're not a GitHub for Windows user, just download a Posh-Git release from (https://github.com/dahlbyk/posh-git[]), and uncompress it to the `WindowsPowershell` directory. | ||
Then open a Powershell prompt as the administrator, and do this: | ||
如果你没有在 Windows 上安装 GitHub,只需要从 (https://github.com/dahlbyk/posh-git[]) 下载一份 Posh-Git 发行版,并且解压至 `WindowsPowershell` 目录。 | ||
然后以管理员权限打开 Powershell 提示符,并且执行下面的命令: | ||
|
||
[source,powershell] | ||
----- | ||
|
@@ -27,4 +27,4 @@ Then open a Powershell prompt as the administrator, and do this: | |
> .\install.ps1 | ||
----- | ||
|
||
This will add the proper line to your `profile.ps1` file, and posh-git will be active the next time you open your prompt. | ||
它将会向你的 `profile.ps1` 文件添加适当的内容,Posh-Git 将会在下次打开提示符时被启用。 |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
但是如果你正在使用 Powershell,那么你就十分幸运了。