作者:finaokas_261 | 来源:互联网 | 2023-09-25 20:05
git的下载安装就不再赘述,基本都是无脑下载安装
对git安装配置感兴趣的,可以看另一篇文章https://blog.csdn.net/Li_na_na01/article/details/105261901
一、本地git的安装和使用
1.配置git的安装目录
在settings中找到版本控制器下的git,在path的位置设置自己git的安装路径

2.创建本地git库
VCS下找到下图内容,选择要提交的项目,完成本地库的创建。此时可看到项目的颜色变化

3.提交项目
在项目(1处)上右键,就可看到Git了(2处)
此时可看见 add 将本地项目提交到暂存区域
commit Directory 将暂存区域中的内容提交到本地仓库

二、对远程中央仓库(github)的操作
(1)本地项目上传github
<1> github上没有对应的仓库
创建远程仓库

设置仓库名和描述信息就可成功创建。若未登录,需要先进行账号密码的身份验证,然后就可以操作了
<2>github上有同名的仓库
1.本地项目换不冲突的名字
2.删除github上无用的仓库
①登录github,找到自己的仓库列表,点击打开要删除的仓库
②点击该仓库下的setting

翻到页面最下端,可看见删除按钮

③点击删除按钮,发现确认删除的按钮是禁用的。
需要根据提示将仓库名(红框内容)填入输入框中。// 若填完仍为禁用状态,需检查前后是否有空格
此时点击删除就


(2)github上的项目检出到本地
1.在VCS下的从版本控制器中检出选择git

2.根据下图提示填写相应的信息,点击clone就可以成功检出项目了
若未登录,正常按提示填写github的账号密码即可
