基本配置参考:pycharm+gitee环境搭建
==============
上传项目
若未初始化git,则会报错:
Successfully created project 'demo1' on Gitee, but initial commit failed:Author identity
unknown *** Please tell me who you are.Run git config --global user.email "you@example.com"
git config --global user.name "Your Name" to set your account's default identity. Omit --global to
set the identity only in this repository. unable to auto-detect email address (got 'Administrator@
PC.(none)')
解决方案:终端上执行以下两条命令:
git config --global user.name "xxx(可以中文)"
git config --global user.email "xxx@gmail.com"
-----------
点击工具栏菜单-->Git(或VCS)-->Gitee-->Share project on Gitee
Repository name:仓库名,一般默认是项目名。
Remote:远程仓库的别名,默认是origin。
私有项目则勾选 Private
然后选择需要提交的代码
----------------------
Clone项目
点击 VCS -> get from Version Control
点击【Log in to GitHub】,输入用户名密码登录:
登录成功以后,点击【Clone】。Git 克隆完成。
在项目中新建文件,弹出提示框:是否将文件添加到 Git。
这里可以勾上 Remember, don’t ask again 在点击【add】,这样就不会每次新建文件都弹出来了。
克隆下来的文件不包含venv和组件依赖,在本地创建venv:
files》settings》Python Interpreter》(齿轮图标)->Add
假如创建了新的venv后,项目的python解释器并不是指向最新创建的这个venv,可以在pycharm窗口右下角的python解释器设置那里重新选择,或者打开配置对话框重设。
如果选项中没有最新创建的这个venv(通常是之前创建了同名/同路径的venv后又删除,对应路径变成了无效造成),那就先选择[无解释器],然后打开项目中的任何一个py文件,在代码窗口顶部按提示重新选择。