使用idea将项目托管到coding

1、确认git已安装,并且环境已配置好

2、用idea或者webstrom打开前台项目配置本地仓库依次选择VCS-> Import into Version Control -> Create Git Repository

3、完成后项目根目录下会生成.git文件,注意有时候是隐藏文件

配置.gitignore文件,不要git上传node_modules文件夹

4、右键项目,在git选项下先add项目然后git->commit

5、连接本地仓库与远程仓库连接,在coding或其他代码托管网站新建远程仓库

右键项目,git->Repository->Remotes...

url中的地址是远程仓库地址

查看:右击项目->git->Repository->pull

在git bash here 中执行git remote add origin + 远程地址

6、然后右键项目 提交和git ->Repository->push

可能遇到问题push to origin/master was rejected

解决办法:在项目文件夹下面按住shift右击选择get bash here分别执行下面两句,代码便提交到coding上了

git pull origin master –allow-unrelated-histories 

git push -u origin master -f

7、在coding上查看代码是否push成功

猜你喜欢

转载自blog.csdn.net/weixin_41996632/article/details/85879726