4.配置單個項目提交時使用的我的信息,命令行進入本地項目的.git文件夾: git
cd mypj git config user.name linsea git config user.email difb@gmail.com之因此要這一步是由於咱們的項目可能不少,不一樣的項目使用不一樣的帳號或git託管服務商,若是不進行這一步,則默認使用全局的我的配置信息,而這每每不是咱們的意願。
5.關聯本地項目與遠程git倉庫,AS沒有提供圖形化的配置(可能我沒有找到),只能用命令行: github
git remote add github-mypj https://github.com/peter/mypj.git //github-mypj是遠程倉庫的名字,自取。https://github.com/peter/mypj.git是倉庫地址.有時,咱們的項目可能關聯到多個遠程倉庫(須要事先像3中同樣建立空項目),這時能夠像上面同樣繼續添加,如:
git remote add osc-mypj http://git.oschina.net/peter/mypj.git
6.初次添加文件,可在AS中選中項目的文件,右鍵Git>Add. 若是用命令行,則爲: shell
git add .用命令行的一個好處是,它用根據.gitignore文件中的配置來過濾掉無關的文件,而用鼠標點選則可能選錯或不全.()可安裝.gitignore插件,無關文件名字會置灰,容易辨認.)
7.提交項目到遠程倉庫.選中AS下面的Changes標籤,選擇剛纔添加的文件,右鍵 > Commit Changes > Commit and Push... > (若是有多個遠程倉庫)勾選Push current branch to alternative branch:選擇相應的遠程倉庫名,如osc-mypj, > Push.輸入帳號密碼,這樣本地文件就上傳到遠程服務器上了. 或者使用命令提交 服務器
git commit -m "first commit" git push -u origin master
.gradle .DS_Store /build /**/*/build .idea/ # built application files *.apk *.ap_ # files for the dex VM *.dex # Java class files *.class # generated files bin/ gen/ # Local configuration file (sdk path, etc) local.properties # Eclipse project files .classpath .project # Proguard folder generated by Eclipse proguard/ # Intellij project files *.iml *.ipr *.iws