kaz*_*ume 32 git version-control android android-studio
我知道这是关于stackoverflow的一个讨论很多的话题,但我无法弄清楚如何使这个工作.我想要:
这是我正在使用的.gitignore(基本上Android Studio创建了一个,我删除了*.iml文件 - 因为它不起作用)
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
Run Code Online (Sandbox Code Playgroud)
但不知何故,它只是不起作用.无论我的gitignore文件是什么样子,Android Studio都无法识别该项目.
所以实际问题:如何将Android Studio项目推送到git所以我可以简单地将其拉入另一个客户端继续工作?
编辑:
所以这就是我如何做的事情,一步一步:
在"左侧项目"下选择"项目"然后在Git"添加"下
提交/推送更改(在流程中定义远程仓库)
在这一点上,该项目是在bitbucket.接下来是"导入项目"部分:
项目加载,我得到一些NullPointerException
Mau*_*ker 33
在另一台计算机上,您可以尝试导入项目,而不是打开它.
实际上,您不必将项目特定文件提交到您的git仓库.Android Studio非常智能,可以从许多不同的来源导入项目.
使用IntelliJ IDEA,您不仅可以从头创建Android项目,还可以导入使用其他工具开发的现有项目.最常见的方案之一是导入现有的Android-Gradle项目.但是,您也可以导入Maven,Eclipse或Flash Builder项目,甚至可以从一堆源文件构建新项目.
像这样:
这里有一个很好的,更详细的教程,介绍如何从源代码和其他地方在Android Studio上导入项目.
对于您的.gitignore文件,我强烈建议您使用gitignore.io网站.
此外,如果您已经提交了不应该存在的文件,请检查此问题并查看如何删除它们.
这.gitignore是我在其中一个项目中使用的文件示例.
# Created by https://www.gitignore.io/api/android,osx,windows,linux,intellij,java
### Android ###
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
### Android Patch ###
gen-external-apklibs
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### Linux ###
*~
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
Run Code Online (Sandbox Code Playgroud)
我已经找到了关于你在寻找什么的这篇非常好的文章:
https://www.londonappdeveloper.com/how-to-use-git-hub-with-android-studio/
您还可以访问CodePath教程以查找更多内容:
https://github.com/codepath/android_guides/wiki/Using-Android-Studio
希望它有所帮助
| 归档时间: |
|
| 查看次数: |
42779 次 |
| 最近记录: |