如何在Android Studio中检出旧的git commit? [英] How do I checkout an old git commit in Android Studio?

查看:81
本文介绍了如何在Android Studio中检出旧的git commit?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查看我的应用在Android Studio中的旧提交,以便对其进行编译和运行.我不想重置为先前的提交或更改我的提交历史记录或类似内容.完成后,我想回到最新版本.

I would like to look at an old commit of my app in Android Studio in order to compile and run it. I don’t want to reset back to the previous commit or change my commit history or anything like that. When I’m done, I want to go back to the latest version.

在命令行上,这很简单

git checkout <hash>

那么我该如何在Android Studio中做到这一点?

So how can I do this in Android Studio?

我没有尝试在命令行上执行此操作,因为我担心从外部修改Android Studio文件时,Android Studio可能会令人胃灼热.确保我可以在Android Studio之外使用git而不会出现问题也可以.

I haven’t tried to do it on the command line, because I’m afraid Android Studio might get heartburn when I modify its files externally. Reassurance that I can work with git outside of Android Studio without problem would be fine too.

推荐答案

如果要使用Android Studio(或其他基于IntelliJ IDEA的IDE)检出提交,只需进入Version Control视图(alt + 9),然后单击Log标签.在Filter输入中键入您的提交哈希,右键单击提交条目,然后单击Checkout Revision选项.

If you want to checkout commit using Android Studio (or other IntelliJ IDEA based IDE) just go toVersion Control view (alt+9) and click the Log tab. Type your commit hash in Filter input, right-click on the commit entry and click the Checkout Revision option.

此外,如果要使用命令行,只需在命令行中使用git.我正在仅使用命令行使用Git,并且还没有发生任何错误.您唯一需要记住的就是等待重新索引结束.

What's more, if you want to work with a command line, simply use git from command line. I'm working with Git using only command line and nothing wrong happend yet. The only thing that you have to remember is to wait for reindexing end.

这篇关于如何在Android Studio中检出旧的git commit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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