Board logo

標題: 最新版的Android Studio, 正確Git設定應該係點? [打印本頁]

作者: 3ldk    時間: 2016-2-21 20:07     標題: 最新版的Android Studio, 正確Git設定應該係點?

用最新版android studio起左一個新project
得到以下幾個file
假如我係用sourcetree, 正確的git設定方法, 應該係在邊個folder底下init? 有邊D folder/file應該ignore? 有邊D folder/file應該include?

成個project入面, default有兩個 .gitignore, 但入面完全無寫到mipmap, 唔通咁都叫正確?


C:\PRO
│  .gitignore
│  build.gradle
│  gradle.properties
│  gradlew
│  gradlew.bat
│  local.properties
│  pro.iml
│  settings.gradle
│  
├─.gradle
│  └─2.4
│      └─taskArtifacts
│              cache.properties
│              cache.properties.lock
│              fileHashes.bin
│              fileSnapshots.bin
│              outputFileStates.bin
│              taskArtifacts.bin
│              
├─.idea
│  │  .name
│  │  compiler.xml
│  │  encodings.xml
│  │  gradle.xml
│  │  misc.xml
│  │  modules.xml
│  │  runConfigurations.xml
│  │  vcs.xml
│  │  workspace.xml
│  │  
│  ├─copyright
│  │      profiles_settings.xml
│  │      
│  └─libraries
│          appcompat_v7_23_1_1.xml
│          support_annotations_23_1_1.xml
│          support_v4_23_1_1.xml
│         
├─app
│  │  .gitignore
│  │  app.iml
│  │  build.gradle
│  │  proguard-rules.pro
│  │  
│  ├─build
│  │  ├─generated
│  │  │  ├─res
│  │  │  │  ├─resValues
│  │  │  │  │  └─androidTest
│  │  │  │  └─rs
│  │  │  │      ├─androidTest
│  │  │  │      │  └─debug
│  │  │  │      └─debug
│  │  │  └─source
│  │  │      ├─aidl
│  │  │      │  ├─androidTest
│  │  │      │  │  └─debug
│  │  │      │  └─debug
│  │  │      ├─buildConfig
│  │  │      │  ├─androidTest
│  │  │      │  │  └─debug
│  │  │      │  │      └─com
│  │  │      │  │          └─pro
│  │  │      │  │              └─test
│  │  │      │  │                      BuildConfig.java
│  │  │      │  │                     
│  │  │      │  └─debug
│  │  │      │      └─com
│  │  │      │          └─pro
│  │  │      │                  BuildConfig.java
│  │  │      │                  
│  │  │      ├─r
│  │  │      │  ├─androidTest
│  │  │      │  │  └─debug
│  │  │      │  └─debug
│  │  │      │      ├─android
│  │  │      │      │  └─support
│  │  │      │      │      └─v7
│  │  │      │      │          └─appcompat
│  │  │      │      │                  R.java
│  │  │      │      │                  
│  │  │      │      └─com
│  │  │      │          └─pro
│  │  │      │                  R.java
│  │  │      │
作者: goofyz    時間: 2016-2-22 19:57

本帖最後由 goofyz 於 2016-2-22 19:58 編輯

gitignore

另行, iml,  .idea我都會 ignore.

Mimap點解唔入 git?

via HKEPC Reader for Android
作者: 3ldk    時間: 2016-2-22 22:40

mipmap係binary黎
放埋入去咪搞到個repo又大又慢?
如果git可以淨係比較日期和size, 另到比較速度快返少少, 咁仲算合理
但git做唔到, 下下都要比較全個file既內容, 咁真係好慢
作者: goofyz    時間: 2016-2-23 11:32

mipmap 都係得一個 launcher icon,大唔得幾多。
如果咁講,drawable 你又放唔放?你覺得 images files 駛唔駛做 source control?
作者: 3ldk    時間: 2016-2-24 02:41

mipmap 都係得一個 launcher icon,大唔得幾多。
如果咁講,drawable 你又放唔放?你覺得 images files 駛 ...
goofyz 發表於 2016-2-23 11:32



全個app入面既圖片都係放係mipmap入面, 好大, 反而drawble入面多數係xml, 算文字性, 不過我認為drawable入面既少量bitmap類圖片, 都應該入埋ignore
而且唔放binary file, 都唔係淨係得我一個講
https://robinwinslow.uk/2013/06/ ... inary-files-to-git/

何況我亦都無話binary唔洗source control, 我只係話bainry無乜要比較內容, 因為無意義, 只要睇filename, size, date就已經足夠去control, 但前提係git都要有依個能力先得
作者: goofyz    時間: 2016-2-24 09:34

全個app入面既圖片都係放係mipmap入面, 好大, 反而drawble入面多數係xml, 算文字性, 不過我認為drawable ...
3ldk 發表於 24-2-2016 02:41 AM



    mipmap 唔係只放 laucnher icon? 定係又改左?


可能我 project 少圖/binary, 所以全 commit 入去。如果唔想 commit 入去,我見有人介紹用 git-annex,可以只保留 tree ,content 另外儲。
作者: 3ldk    時間: 2016-2-28 01:59

應該無改過, 由mipmap第一日出現開始, 全部圖都係放入面





歡迎光臨 電腦領域 HKEPC Hardware (https://h1.hkepc.com/forum/) Powered by Discuz! 7.2