Idea将已有项目放到远端git
1、打开Idea,VCS ——> Import into Version Control ——> Create Git Repository ——> 选择本地要导入到git的项目
2、选中项目右键,Git ——> Commit Directory
将对应的文件Commit到本地
3、选中项目右键,Git ——> Repository ——> Push,弹出下面框
在url处填写远端git地址,然后点击Push 提交
4、在push之后会有如下错误
解决:按Alt+F12打开idea的终端,然后在终端执行下面三个命令
git pull
git pull origin master
git pull origin master --allow-unrelated-histories
最后再 Git ——> Repository ——> Push项目
5、在这个过程中有可能会报如下错误:
--author 'xxxxx' is not 'Name <email>' and matches no existing author
可能是设置的git用户名,密码凭证有问题,到控制面板 --> 用户账户 --> 管理你的凭据,查看git的账号密码是否正确