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。