At work we are now in the process of migrating from Eclipse to Android Studio, but one of the challenges we are facing is actually keeping all of our local history from git when the import is done.
I followed this directions to do the merge with git: https://stackoverflow.com/a/24741965/2489037
...And my co-workers are able to download the whole project from git using SourceTree with no major problems, but we are still unable to compare any of the project's files with the remote versions from other branches (The ones we were using with Eclipse). When I left-click a file -> git -> compare with branch... then select one of the Eclipse branches (That I know has the file) I get the error: File Doesn't exist in branch
So, the question is: How can we compare files from the imported Android Studio Project with their pairs in the Eclipse branches? Is it possible?
We really can't lose the local history, and we also can't be switching back to Eclipse all the time to check older versions of the files.
答案 0 :(得分:0)
文件路径是否已在存储库中移动?可能是新IDE中的git客户端无法跟随重命名。您应该能够使用命令行客户端确定提交是否存在;这会告诉你它是IDE还是存在问题的存储库。
答案 1 :(得分:0)
解决:
事实证明,即使Git认可该项目,我也能够在分支之间切换(意味着项目结构已经改变以适应Eclipse或Android Studio),文件有不同的路径,因此git isn&# 39;能够将它们与旧版本联系起来。 对于解决方案,我按照以下步骤操作:
在Android Studio分支中,我将res和src文件夹从它们在AS项目结构中的位置复制到应该在Eclipse(主文件夹)中创建项目的位置。
使用命令行我使用命令git mv -v -f source_folder destination_folder
完成!现在,AS可以使用左键单击 - >将java文件与旧版本进行比较。 git - >与...比较
我仍然无法与其他分支进行比较,因为文件的路径不同,但由于我们不再继续使用这些分支,因为我们不再在Eclipse中开发,这个解决方案对我们有用鉴于我们可以访问所有以前版本的文件以供将来参考。