需要的工具:
1.InteillJ IDEA
2.Git
3.GitHub帳号
步驟:
1.下載下傳Git
<a href="https://git-scm.com/downloads" target="_blank">下載下傳位址:https://git-scm.com/downloads</a>
安裝完成後
勾選Launch Git,彈出來下面視窗代表安裝Git成功
最後在這個視窗中鍵入:
注意<code>git config</code>指令的<code>--global</code>參數,用了這個參數,表示你這台機器上所有的Git倉庫都會使用這個配置!!!
2.GitHub帳号注冊
<a href="http://www.cnblogs.com/sxdcgaq8080/p/7125255.html" target="_blank">參考:http://www.cnblogs.com/sxdcgaq8080/p/7125255.html</a>
3.下來就在Idea上折騰了
1》将Git啟動程式加入Idea
File-->setting-->Vsersion Control-->Git--->Path to Git executable-->選中安裝的git.exe之後,點選Test-->彈出下面的successfully視窗即可!
2》設定連接配接GitHub
File-->Setting-->Version Control-->GitHub-->選擇驗證方式使用password驗證--->輸入使用者名密碼-->Test-->彈出successfully視窗即可
3》建立本地Git倉庫
VCS -->Import into Version Control -->Create Git Repository
然後選中項目所在位置:
Ok之後,項目全部變紅
然後選擇把項目新添到Git
Git-->add
add之後變成綠色
然後送出項目到Git
Git--->commit Directory
填寫 作者名,填寫message
完全送出了之後,整個項目檔案都變成白色的了
4.送出項目到GitHub
VCS--->Import into Version Control -->share Project on GitHub
像上面這樣,根本送出不上去,報錯如下:
是以,隻好修改為如下:
第一次送出彈出來輸入GitHub使用者名密碼的相關資訊,但是也沒有輸入,也成功送出上去了!!
你現在就可以點選連結檢視新上傳到GitHub上的代碼了!
5.送出修改的檔案到GitHub上
然後右鍵項目
Git--->commit Directory--->Commit and push
不止要送出 還要推送到GitHub上。
push 成功之後,就可以在GitHub上看到了
如果送出不成功的話,會提示相關的沖突錯誤等等,根據問題進行排查即可!!!
==========================================================================
完結了!!!