-第一步:注冊帳號
注冊帳號地址:
https://bintray.com/signup/oss,https://bintray.com/signup/oss,https://bintray.com/signup/oss(重要的事情說三遍,不要自己在百度搜bintrary官網(wǎng)注冊,不聽勸者,后果自負,(對,沒錯,這就是我遇到的最后一個坑,我現(xiàn)在拿到第一步來說))

-第二步:創(chuàng)建倉庫
當(dāng)我們成功的注冊了帳號并且成功了登錄的時候(嗯,你說的沒錯,我注冊帳號花了1個小時,當(dāng)時死磕QQ163郵箱,平時就用這倆,哈哈)


-第三步:獲取bintray帳號Key
步驟一:

步驟二:

步驟三:

步驟四:

到這里,JCenter線上操作已經(jīng)完成,接下來我們開始配置AndroidLibrary項目
AndroidLibrary區(qū)
0.創(chuàng)建一個全新的Android項目







在
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
添加
classpath 'com.novoda:bintray-release:0.8.0'
最終結(jié)果:
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.novoda:bintray-release:0.8.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
3.配置Library的build.gradle


在文件頂部添加
apply plugin: 'maven'
apply plugin: 'com.novoda.bintray-release'
最終結(jié)果:
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'com.novoda.bintray-release'

publish {
userOrg = '***'
groupId = 'com.wawi.android.utils'
artifactId = 'utils'
version = '0.0.1'
description = '這是一個utils的集合'
website = "https://github.com/novoda/$ rootProject.name"
}
提交到JCenter倉庫
gradlew clean build bintrayUpload -PbintrayUser=****** -PbintrayKey=****************************-PdryRun=false --info
提交到github 上就改成這
website = "https://github.com/laogong/wawiUtils"
這是提交到自己的github
還要在github上新建


創(chuàng)建成功之后 克隆到本地

接下來就到本地操作了,首先右鍵你的項目,如果你之前安裝git成功的話,右鍵會出現(xiàn)兩個新選項,分別為Git Gui Here,Git Bash Here,這里我們選擇Git Bash Here,進入如下界面,waiwidemo即為我的項目名。

接下來輸入如下代碼(關(guān)鍵步驟),把github上面的倉庫克隆到本地


出現(xiàn)這種情況說明沒有創(chuàng)建私鑰公鑰
一步步創(chuàng)建吧



進去一步步的照著敲

把得到的秘鑰復(fù)制到github上去保存

然后提交
git add -A

git commit -a -m "Init commit"

登陸


這樣就能引用了
也可以用sourcetree提交到github
https://www.sourcetreeapp.com/ 下載下來 安裝
需要跳過登錄 在安裝目錄新建:
%LocalAppData%\Atlassian\SourceTree
新建 accounts.json 文件
[
{
"$id": "1",
"$type": "SourceTree.Api.Host.Identity.Model.IdentityAccount, SourceTree.Api.Host.Identity",
"Authenticate": true,
"HostInstance": {
"$id": "2",
"$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountInstance, SourceTree.Host.AtlassianAccount",
"Host": {
"$id": "3",
"$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountHost, SourceTree.Host.AtlassianAccount",
"Id": "atlassian account"
},
"BaseUrl": "https://id.atlassian.com/"
},
"Credentials": {
"$id": "4",
"$type": "SourceTree.Model.BasicAuthCredentials, SourceTree.Api.Account",
"Username": "",
"Email": null
},
"IsDefault": false
}
]
成功時候打開本地項目

添加ssh秘鑰


彈出dos命令 輸入密碼
先拉取再提交