【发布时间】:2020-12-20 13:22:02
【问题描述】:
我在 github 上创建了一个 repo,作为我跟踪更改的最后一年项目,并且我有一个 MacBook 可以移动,并且当我在家时也可以在我的工作站上工作;
我在 github 上创建了一个空的 repo,然后将 android 项目从我的工作站推送到 github。工作了一段时间,并在几分钟前从写这篇文章并在我的 macbook 上克隆了该项目,并在几分钟前运行了基本的东西并推送了代码。我在我的 macbook 上选择了该项目,几秒钟后,当 Android Studio 完成“索引”文件时,我看到有 MainActivity2.kt 和 activity_main2.xml(我没有创建)。我吓坏了,做了一个git status,这表明本地仓库没有任何变化。
然后我在我的 Mac 上关闭了 Android Studio,删除了上述本地 repo 并打开了 Android Studio(作为一种安全措施,我知道我为什么这样做)并且还从最近的标签中删除了该项目。我再次克隆了 repo,现在我拥有了所有(我所知道的 - 因为我是 android studio + kotlin 的新手).kt 和 .xml 文件以及它们的 <file-name-goes-here>2.kt 和 <file-name-goes-here>2.xml;
我又做了一个 git status,它向我展示了这个。我不知道为什么要创建重复项。
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .idea/gradle.xml
Untracked files:
(use "git add <file>..." to include in what will be committed)
app/src/androidTest/java/com/kinkykeys/countmein/ExampleInstrumentedTest 3.kt
app/src/main/AndroidManifest 2.xml
app/src/main/java/com/kinkykeys/countmein/MainActivity 2.kt
app/src/main/java/com/kinkykeys/countmein/disaster_forecast 2.kt
app/src/main/java/com/kinkykeys/countmein/home 2.kt
app/src/main/java/com/kinkykeys/countmein/scan 2.kt
app/src/main/res/drawable-v24/ic_launcher_foreground 3.xml
app/src/main/res/drawable/ic_launcher_background 3.xml
app/src/main/res/layout/activity_main 2.xml
app/src/main/res/layout/disaster_forecast 2.xml
app/src/main/res/layout/home 2.xml
app/src/main/res/layout/scan 2.xml
app/src/main/res/mipmap-anydpi-v26/ic_launcher 3.xml
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round 3.xml
app/src/main/res/mipmap-hdpi/ic_launcher 3.png
app/src/main/res/mipmap-hdpi/ic_launcher_round 3.png
app/src/main/res/mipmap-mdpi/ic_launcher 3.png
app/src/main/res/mipmap-mdpi/ic_launcher_round 3.png
app/src/main/res/mipmap-xhdpi/ic_launcher 3.png
app/src/main/res/mipmap-xhdpi/ic_launcher_round 3.png
app/src/main/res/mipmap-xxhdpi/ic_launcher 3.png
app/src/main/res/mipmap-xxhdpi/ic_launcher_round 3.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher 3.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round 3.png
app/src/main/res/values-night/themes 3.xml
app/src/main/res/values/colors 3.xml
app/src/main/res/values/strings 3.xml
app/src/main/res/values/themes 3.xml
app/src/test/java/com/kinkykeys/countmein/ExampleUnitTest 3.kt
no changes were added to commit (use "git add" and/or "git commit -a")
另外,我刚刚注意到有一些文件还有第三个副本(colors 3.xml、strings 3.xml 和 themes 3.xml)
这是link to my github repo,以防我的代码内容有问题,但我希望它与Android Studio有关。
【问题讨论】:
-
这绝对看起来像某些云同步服务已进入您的存储库。你绝对应该避免这些,因为他们会做这样的事情。
标签: android git android-studio