先在遠(yuǎn)程git服務(wù)器創(chuàng)建一個空的倉庫
首先確保git正確安裝
測試:打開studio,File - Setting -Version Controll -Git 最上方選擇Git的安裝目錄下的git.exe文件焊唬,點(diǎn)擊右側(cè)的Test按鈕看靠,測試是否配置成功VCS --> Enable Version Controll Integration中選擇Git,給項(xiàng)目配置Git鸥滨,配置成功后婿滓,出現(xiàn)項(xiàng)目右鍵出現(xiàn)Git選項(xiàng),窗體上方有Pull凸主,Push 圖標(biāo)额湘。
項(xiàng)目根目錄右鍵--git锋华,加號 add
項(xiàng)目根目錄右鍵 --> git --> Commit Directory,提交文件---->添加提交信息供置,選擇commit 或 commit and Push,添加提交信息 commit message
第一次提交填寫遠(yuǎn)程Git的地址
上一步后點(diǎn)擊Define remote芥丧,再URL 項(xiàng)填寫git遠(yuǎn)程倉庫地址续担,點(diǎn)擊OK即可。
附命令行上傳:
1. cd 到項(xiàng)目根目錄物遇,執(zhí)行g(shù)it init
2. git add .
3. git commit -m "提交 message"
4. git remote add origin 遠(yuǎn)程地址
5. git push --set-upstream origin master