idea首次提交代码到gitee

idea首次提交代码到gitee

打开gitee,创建一个私有仓库,复制这个仓库的url地址。在commit的时候会用到
关联idea中的项目和gitee仓库,操作步骤参考如下链接
https://jingyan.baidu.com/article/9c69d48fe68cce13c9024e9c.html
idea首次提交代码到giteeidea首次提交代码到gitee未add前是红色的
idea首次提交代码到gitee
idea首次提交代码到giteeadd后变绿
idea首次提交代码到gitee
commit以后变白色,commit后和push后颜色相同无变化,commit时写上注释。下图springboot未push

idea首次提交代码到gitee
然后push,vcs–>git–>push,出现下图说明push到远端成功。
idea首次提交代码到gitee
前面过程如上链接,但是操作到push的时候,发现push失败,Push to origin/master was rejected?怎么解决?
git pull origin master –allow-unrelated-histories --把远程仓库中的内容 pull 到本地工作目录
git push -u origin master -f --在 pull 下来的项目中做修改,通过以上命令 push 到远程仓库了
如果以上命令不行,则删掉项目所在目录的.git文件,重新关联一下即可。

电脑基本操作:

  1. 显示出windows7中隐藏的目录,点击:组织–>文件夹和搜索选项–>查看–>显示隐藏的文件。

idea首次提交代码到giteeidea首次提交代码到gitee

  1. 删除windows7中的某个文件被告知没有权限时,则首先获取管理员权限:

https://jingyan.baidu.com/article/295430f19508410c7e0050d9.html

  1. 然后发现还是不能删除?怎么办?

https://jingyan.baidu.com/article/8275fc86c6bbb706a13cf631.html

  1. 命令行执行不了git命令?

是因为没有配置环境变量,找到git安装目录,分别找到如下的目录,配置到系统变量Path中。然后cmd打开黑窗口,输入git,有反应则说明配置成功。
;D:\CommonSoftware\Git\Git\cmd;D:\CommonSoftware\Git\Git\bin