GIT&Pycharm组合使用

git、pycharm组合使用

当前已安装git,pycharm

1、配置git

打开 Preferences -> Settings -> Version Control -> Git,在 Path to Git executable 处选择 git 的安装位置,配置成功后点击test,如成功,则会显示git版本信息:
GIT&Pycharm组合使用
GIT&Pycharm组合使用

2、配置github

VCS -> Checkout from Version Control -> Git,输入 GitHub 仓库的地址和本地目录,点击clone(仓库地址为github上已有的项目、本地目录地址需为空);输入后可点击test进行验证;
GIT&Pycharm组合使用
点击login,登录github账号
GIT&Pycharm组合使用

3、提交代码至git

选择刚刚的目录,新建file,弹窗选择yes;VCS -> Git -> Commit File…,输入 Commit Message 后点击下方【Commit】按钮。注意,提交日志必须填;
GIT&Pycharm组合使用
GIT&Pycharm组合使用
GIT&Pycharm组合使用

3、提交代码至github

VCS -> Git -> Push;将代码提交到 GitHub
GIT&Pycharm组合使用
GIT&Pycharm组合使用
GIT&Pycharm组合使用