Android Studio 中的 Git 不见了?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34990779/
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
Git in Android Studio disappeared?
提问by Ralf Wickum
When I right-clicked in my Android Studio project (in the Android view), I used to have a "Git"submenu. There I could pull, push, etc.
当我右键单击我的 Android Studio 项目(在 Android 视图中)时,我曾经有一个“Git”子菜单。在那里我可以拉、推等。
However, that 'Git' menu is now gone, somehow. As a result, I can neither push nor pull. Where can I enable that again?
然而,不知何故,那个“Git”菜单现在不见了。结果,我既不能推也不能拉。我在哪里可以再次启用它?
回答by Amit Vaghela
Try this way ,
试试这个方法
- In Android Studio enable the version control for the project by, VCS –> Enable Version Control Integration
- Open command line/terminal and add the project to Git repository by, git remote add
- Add files by, VCS –> Git –> Add and commit/push by, VCS –> Commit Changes
- 在 Android Studio 中,通过 VCS –> Enable Version Control Integration 为项目启用版本控制
- 打开命令行/终端,通过 git remote add 将项目添加到 Git 仓库
- 添加文件,VCS –> Git –> 添加和提交/推送,VCS –> 提交更改
Checkout Android Studio Git Tutoriallink for more detail.
查看Android Studio Git 教程链接以获取更多详细信息。
as well as check this Stack Explaination.
以及检查这个堆栈解释。
In Android Studio, go to ‘File' –> ‘Settings' –> ‘Version Control' –> ‘Git'.Then click ‘Test' to ensure that Git is configured properly in Android Studio.
Prior to using Git or any other version control with an existing project, ‘version control integration' should be enabled. In Android Studio, got to ‘VCS' –> ‘Enable Version Control Integration'. This step is for an already existing project in Android Studio, that is not is integrated with any version control.
在 Android Studio 中,转到“文件”->“设置”->“版本控制”->“Git”。然后单击“测试”以确保在 Android Studio 中正确配置了 Git。
在对现有项目使用 Git 或任何其他版本控制之前,应启用“版本控制集成”。在 Android Studio 中,转到“VCS”->“启用版本控制集成”。此步骤针对的是 Android Studio 中已存在的项目,未与任何版本控制集成。
回答by ox black
A simple Gradle-Sync is fixing this for me. I had this after every "stash" or "unstash" now (Android Studio 3.5.3)
一个简单的 Gradle-Sync 正在为我解决这个问题。我现在在每次“隐藏”或“取消隐藏”之后都有这个(Android Studio 3.5.3)
回答by Oleg
In my case the plugins "Git" and "GitHub" ware disabled. I enabled them (Settings->Plugins->Installed) and menu "Git" had been appeared.
在我的情况下,插件“Git”和“GitHub”被禁用。我启用了它们(设置->插件->已安装)并且出现了菜单“Git”。
回答by Mehdi Khademloo
If you don't have git repo on your project, just create a git repo on your project folder, something like
如果您的项目中没有 git repo,只需在您的项目文件夹中创建一个 git repo,例如
git init
and when you have git repo already, just close the project from android studio and re-open it. let android studio to refresh itself...
当你已经有了 git repo 时,只需从 android studio 关闭项目并重新打开它。让android studio自己刷新...
回答by Habibur Rahman
Try this:
尝试这个:
Settings -> Plugins -> Install JetBrains Plugin -> Type "Git" on search
设置 -> 插件 -> 安装 JetBrains 插件 -> 在搜索中输入“Git”
Then Install: VCS Annotations Preloader
然后安装:VCS Annotations Preloader
Hope this process will solve your problem
希望这个过程能解决你的问题
回答by Nurseyit Tursunkulov
at eventLog it will show error, git is not integrated. Press to integrate it and the problem will be resolved
在 eventLog 它将显示错误,git 未集成。按集成它,问题将得到解决
回答by Jonathan Ma
I find that, if I clone the code with terminal, the Git menu is not among the options of VCS menu.
我发现,如果我用终端克隆代码,Git 菜单不在 VCS 菜单的选项中。
What I did was:
我所做的是:
- Click VCS menu.
- Checkout from version control.
- Select Git.
- Fill all the necessary info in the popup window.
- After cloning the code, there is a prompt saying Android Studio needs to be restarted. (Just restart it.)
- The Git menu should appear after restarting Android Studio.
- 单击 VCS 菜单。
- 从版本控制签出。
- 选择 Git。
- 在弹出窗口中填写所有必要的信息。
- 克隆代码后,提示需要重启Android Studio。(只需重新启动它。)
- 重启 Android Studio 后应该会出现 Git 菜单。