1. 安装EGit插件

Eclipse使用github并开启命令行_下载安装


2. 导入git项目

选择Import:

Eclipse使用github并开启命令行_git_02


选择“Clone URI”

Eclipse使用github并开启命令行_命令行_03


输入想要导入的git项目地址和用户名密码:

Eclipse使用github并开启命令行_下载安装_04


选择代码分支:

Eclipse使用github并开启命令行_命令行_05


一路点击next完成导入github项目即可。

3. 开启命令行

下载安装git

Eclipse使用github并开启命令行_git_06


选择 “Run -> External Tools -> External Tools Configurations”

Eclipse使用github并开启命令行_命令行_07


在Program右键 -> New

设置“main”:设置安装git目录下的​​git-cmd.exe​​路径;设置“common”页面:

Eclipse使用github并开启命令行_git_08


Eclipse使用github并开启命令行_命令行_09


设置完成后,点击​​Run​​运行命令行控制台。

运行界面如下:

Eclipse使用github并开启命令行_命令行_10



命令行控制台关闭后想再次打开,可通过Run -> External Tools -> External Tools Configurations找到配置好的console打开