如何在 Windows 上通过 SourceTree 使用 git 命令行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25503601/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:20:12  来源:igfitidea点击:

How to use git command line via SourceTree on Windows

gitatlassian-sourcetree

提问by Pascal Klein

I am currently using SourceTree on Windows 7. If I run into any problems with my git repository the solutions online always rely on the command line. Is there anyway to enter these commands in SourceTree?

我目前在 Windows 7 上使用 SourceTree。如果我的 git 存储库遇到任何问题,在线解决方案总是依赖于命令行。有没有办法在 SourceTree 中输入这些命令?

回答by pqnet

From the Actionsmenu select Open In terminal. You will be presented with a poor shell in which you can use git commands

Actions菜单中选择Open In terminal。你将看到一个糟糕的 shell,你可以在其中使用 git 命令

回答by Andrei Karcheuski

Another way to open that poor shell is just by clicking on Terminal icon in the main window
enter image description here

打开那个糟糕的外壳的另一种方法是点击主窗口中的终端图标
在此处输入图片说明

回答by mikemaccana

You can also use Sourcetree's embedded git from the terminal. Add this to your powershell profile:

您还可以从终端使用 Sourcetree 的嵌入式 git。将此添加到您的 powershell 配置文件中:

Add-PathVariable "${env:UserProfile}\AppData\Local\Atlassian\SourceTree\git_local\bin"