Visual Studio Code 使用 Git 进行版本控制
Visual Studio Code 编写MarkDown :http://www.jianshu.com/p/18876655b452
感谢大神:http://blog.csdn.net/xuanhun521/article/details/52994915
请确保你安装了最新的 VS Code.http://code.visualstudio.com/
请确保安装了最新版的 Git。https://git-scm.com/download。
git 安装到环境变量里, 确保任意路径可以访问。
参考链接:https://code.visualstudio.com/Docs/editor/versioncontrol
VS Code 集成了 Git 功能,并支持基本的 git 命令,这使得我们能够在开发过程方便的提交和获取代码。`
初始化
首先我们创建一个名为 gittest 的文件夹,当然它不在 git 的版本控制管理中。

用 VS Code 打开这个文件夹,单击左侧的 git 图标。

我们可以看到“初始化 GIT 存储库”的按钮,单击。

初始化之后,我们首先看到的是 git 栏里显示了当前所有文件,有 4 个更改。

全部或者单个文件都可以选择暂存或者清理掉。

在上方有提交和刷新按钮,下拉菜单里有更多选项。 再回到我们的文件中,刚才的操作创建了一个。git 文件夹,放置了当前仓库的所有 配置文件,如下图。

到目前为止我们在本地创建了一个代码仓库,下面来看一下 VS Code 的 git 功能。
git 输出
我们可以在隐藏的菜单中选择 git 输出,这样我们每个操作都会显示 在输出区域,方便我们查看对应的 git 命令。

提交保存
提交保存的第一步是暂存文件。
第二步是输入提交信息。
第三步然后使用状态栏的提交按钮提交全部更改。

git 命令列表
ctrl+shift+P,输入 git,会看到 VS CODE 支持的所有 git 命令。

撤销操作
输入 Undo Last Commit,撤销上次操作。输入 Unstage, 撤销暂存。

分支
输入 Branch 可以创建当前内容的分支。创建分支时需要输入分支名称。


checkout
创建分支后,使用 checkout 命令可以拉取特定的分支内容。

冲突合并
VS Code 会检测文件冲突,并以<<<<<,>>>>,==== 和颜色区分出来。

解决冲突之后,直接提交就行了。
文件比较
在 git 文件列表中,单击一个未提交更改的文件,就会打开两个窗口来显示变更的内容。
