本文介绍了如何从命令行打开 SourceTree?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种快速简便的方法可以从命令行在 SourceTree 中打开 git 存储库?

Is there a quick and easy way to open a git repository in SourceTree from the command line?

我在终端上做了很多 git 工作,但有时无法替代良好的历史视图/差异.希望能够在不使用书签的情况下打开.

I do a lot of git work from Terminal, but sometimes there's no replacement for a good history view/diff. Would love to be able to open without using bookmarks.

推荐答案

安装 SourceTree 命令行工具将为您提供 stree 命令.这将允许您在 SourceTree 中打开当前目录.

Installing the SourceTree Command Line Tools will provide you with the stree command. This will allow you to open the current directory in SourceTree.

您还可以指定一个特定的存储库路径

You can also specify a particular path to a repo

stree ~/my-repo-in-another-folder

如果出于某种原因无法安装命令行工具,您还可以执行以下操作:


If installing command-line tools isn't an option for whatever reason, you can also do the following:

open -a SourceTree path-to-file

并且可能在 .bashrc 或 .zshrc 中设置别名

and maybe set up an alias in .bashrc or .zshrc

alias sourcetree='open -a SourceTree'

对于那些使用 SourceTree 3 的人

For those who are using SourceTree 3

alias sourcetree='open -a SourceTree 3'

这篇关于如何从命令行打开 SourceTree?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 23:00