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

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

问题描述

我想在 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.

在命令行上,这将是一个简单的

On the command line, this would be a simple

git checkout <hash>

那么我如何在 Android Studio 中执行此操作?

So how can I do this in 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 提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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