VisualCode集成github功能,是程序猿參與開源項目的利器。相比Sublime簡單了不少(插件安裝繁瑣,好比你試試在Sublime2 安裝gosublime,這裏有坑; Sublime 3修復了Package Control的Bug)。總之,有大牛Erich Gramma負責的項目值得信賴,主要差異是生產效率。git
對VisualCode還不是特別熟悉,今天使用一種混合模式進行github開源項目開發-即便用iTerm2終端clone項目,在VisualCode進行編輯和提交,在github網站生成Pull Request。步驟以下:github
1)git clone https://github.com/beepone/bootstrap.gitbootstrap
2)cd bootstrap網站
3)在VisualCode打開上述目錄,編輯某個文件插件
4)點擊左側github圖標,VC自動發現change,而後輸入message,按下Command+Enter開發
5)在iTerm2終端裏面,在當前目錄,輸入git push ,注意在此以前最好設置全局用戶名和郵箱,以避免出現Unrecognized author警告。rem
git config --global user.name "yourname in github"it
git config --global user.email yourname@company.comio
6)提交成功,你應該能看到如下信息ast
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 281 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/beepony/bootstrap.git
8f0dd8a..2f783ca master -> master
若是想rollback剛纔的commit,輸入如下兩個命令
git reset --hard HEAD^
git push origin HEAD --force
輸出:
Total 0 (delta 0), resued 0 (delta 0)
To https://github.com/beepony/bootstrap.git
+ f4cc153...8f0dd8a HEAD -> master (forced update)
最後,在github項目裏,找到commit,單擊進入一個頁面,能夠建立Pull Request。