尝试使用Git的与Android工作室 [英] Trying to use Git with Android Studio

查看:309
本文介绍了尝试使用Git的与Android工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过我们在很长一段时间试图与Git和Android的工作室工作的朋友,但是我们有一个问题(我们是很新的Git和Android的工作室,我们开始了前两天有关这两个问题)。

With a friend we were a long time trying to work with Git and Android Studio, but we had a problem (we are very new to git and Android Studio, we started a couple of days ago on both issues).

我们的结局是,例如,如果我克隆Git仓库,我尝试做一个合并,那么执行按钮是灰色的,它不会让我编译或运行它,另外,如果我显示项目结构,Android或包我什么也看不见,我只能看到项目,项目文件,最近更改,文件等...

What happens to us is that, for example, if I cloned the git repository and I try to make a merge, then the button to execute is grayed out and it doesn't let me compile or run it, also if I display the project structure as Android or Packages I see nothing, I can only see the files in Project, Project Files, Recent Changes, etc...

我将所有的细节我们所做的解释。

I will explain in detail everything we've done.

首先,库看起来像这样(P和C都只是缩写)。

First, the repository looks like this (p and c are just the initials).

  x (c)
 /
x (master)
 \
  x (p)

法师有第一初始提交使用的.gitignore和README.md,仅此而已,而我们(我是谁创造的分支P,和我的朋友是谁创造的branc C)只有一个承诺每一个有可执行的项目,虽然我没有兴趣加入我所用我朋友做了做,我只是想开始Android的工作室,与我的朋友做了一个新的项目。

Master has the first initial commit with .gitignore and README.md, nothing more, while we (me who created the branch p, and my friend who created the branc c) have just one commit each one with executable projects, although I'm not interested in joining what I've done with what my friend has done, I just want to start a new project of Android Studio with what my friend has made.

于是我开始Android的工作室,从版本控制签出项目 - > GitHub上,我把我的钥匙,并选择我要克隆库,之后AS问我,如果我想创建一个新的项目,我点击是的。

So I start Android Studio, "Check out project from Version Control -> GitHub", I put my key and choose the repository I want to clone, after that AS ask me if I want to create a new project and I click Yes.

我打,直到下一个新的项目被创建,在这里我可以看到,我们已经在GitHub上创建的所有分支。

I hit next until the new project is created and here I can see all the branches that we have created on GitHub.

在我做一个本地分支试图用我朋友的项目工作,可以选择混帐分支 - >新科,并称之为P,它自动移动我这个支部

After that I make a local branch to try to work with the project of my friend, with the option "Git branches -> New Branch" and calling it p, which moves me to this local branch automatically.

在这之后,我选择了远程分支来源/ C的合并选项,我也得到一个合并失败,说:一些未跟踪的工作树中的文件将被合并被覆盖,请移动或删除它们,然后才能合并。 我选择要查看的文件的选项,它显示了我这些。

After that, I choose the Merge option of the remote branch origin/c, and I get a merge failure, that says "Some untracked working tree files would be overwritten by merge. Please move or remove them before you can merge.", I choose the option to view the files and it shows me these.

因为我的项目是全新的,而我的朋友上传的罚款为他的项目,我只是删除这些文件与我的鼠标指向红酒吧,之后会出现一个消息,说现在有没有什么区别。

Since my project is completely new, and the project that my friend uploaded worked fine for him, I just deleted these files with the red bar that my mouse is pointing and after that a message appears that says there is no difference now.

最后,在这之后,我再去远程分支C的合并选项,并出现冲突的消息,这是对的.gitignore文件中,在我的情况,我把为接受他人的,我看到了消息合并是正确的。

Finally, after that, I go again to the merge option of the remote branch c, and a conflict message appears, which is on the .gitignore file, in my case I put to "Accept Theirs", and I see the message that the merge was correctly.

而现在它是当我看到执行按钮是灰色的,如果我显示项目结构为Android的我什么也看不见,我只能看到项目,项目文件,文件等等...

And now it is when I see that the button to execute is grayed and if I display the project structure as Android I see nothing, I can only see the files in Project, Project Files, etc...

我想这应该是基本的超我在问什么,但我们(我和我的朋友)从来没有使用Git或Android工作室工作,现在我们被要求用他们做一个项目。

I think it should be something super basic what I'm asking, but we (me and my friend) had never worked with git or android studio and now we are asked to make a project using them.

推荐答案

其次@ AKHIL的回答,请点击制作项目图标来唤醒你的运行按钮。有时,这种按钮可以使Android Studio中认识你的项目可运行一次。

Followed by @Akhil's answer, click "Make Project" icon to awake your Run button. Sometimes this button makes Android Studio recognize your project runnable again.

这篇关于尝试使用Git的与Android工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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