有没有办法检索eclipse执行的git命令? [英] Is there a way to retrieve eclipse executed git commands?

查看:351
本文介绍了有没有办法检索eclipse执行的git命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个常规的git用户,我正在eclipse中建立一些快捷方式来激活一些EGit功能。



我有点担心什么是EGit做(特别是同步工作区操作),我想知道是否可以使EGit显示正在使用的git命令。 >

你知道一个选项使其登录到控制台,或者一般来说,如何找出执行哪些命令?

解决方案

EGit 不使用git可执行文件。它在 JGit 的帮助下重现,可执行文件将执行哪些操作。



Git可执行文件将项目的版本控制状态存储在.git文件夹下的多个文件(分支,参考,提交对象,标签等)中。



EGit和JGit也一样。






例如:



提交git可执行文件:

  git commit -m我的提交消息

将通过EGit执行Java,使用 CommitOperation.commit(),它使用JGit的 CommitCommand.call (),其中 builds insert 一个提交对象,哪些是代表通过文件






EGit的UI操作和它们的含义之间没有明确的映射作为常规的git命令,至少我不知道。



可以通过( EGit JGit git )的代码,然后查找引擎盖下发生的事情。






编辑:JG中的pgm包它提供了逆映射:命令行界面使用JGit实现的Git命令(pgm代表程序)


I'm a regular git user, and I'm building some shortcuts in eclipse to activate some EGit functions.

I'm a bit wary of what is EGit doing (especially the synchronize workspace operations), and I was wondering if I could make EGit show what git commands it was using.

Do you know of an option to make it log to the console, or generally, how to find out which commands got executed?

解决方案

EGit does not use the git executables. It reproduces, with the help of JGit, what the executables would do.

Git executables store the versioning state of a project in a number of files under the .git folder (branches, refs, commit objects, tags and so on).

EGit and JGit do the same.


For example:

A commit with git executables:

git commit -m "My commit message"

Would be executed in Java through EGit with CommitOperation.commit(), which uses JGit's CommitCommand.call(), which builds and inserts a commit object, which are representend through files.


There is no clear mapping between EGit's UI operations and their meaning as regular git commands, at least not to my knowledge.

One can go through (EGit, JGit, git)'s code and look for what is happening under the hood, though.


EDIT: a pgm package in JGit provides the inverse mapping: "Command-line interface Git commands implemented using JGit ("pgm" stands for program)"

这篇关于有没有办法检索eclipse执行的git命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆