使用终端检查电脑是否安装Git git --version
通过此文章安装Git ➡️ 传送门🌐
方式1⃣️使用终端操作
1.下载------克隆远程仓库到本地
git clone [远程地址]

例:git clone https://gitee.com/lcannal/movie.git

2.编辑------对项目进行添加、修改等操作
通过IDEA打开项目对其进行添加、修改等操作
3.添加------添加到暂存区
git add [项目文件名]
例如:git add Springboot_movie

4.提交------将暂存区内容提交到本地库
git commit -m "提交信息" [项目文件名]
例如:git commit -m "第一次提交" Springboot_movie


5.更新------更新本地仓库
git pull --rebase [远程地址 master]
例如: git pull --rebase https://gitee.com/lcannal/movie.git master

6.上传------上传至远程仓库
git push [远程地址 master]
git push https://gitee.com/lcannal/movie.git master

💠Git流程图

方式2⃣️使用IDEA
1.idea绑定GIT

2.在IDEA中从Gitee下载项目

3.添加代码到暂存区

4.提交代码到本地仓库并上传

💠Git基本命令
- git init:在当前目录初始化一个新的Git仓库。
- git clone [url]:克隆远程仓库到本地。
- git add [file]:将文件添加到暂存区。
- git commit -m "message":将暂存区的文件提交到本地仓库,-m参数指定提交信息。
- git push:将本地仓库的提交推送到远程仓库。
- git pull:从远程仓库拉取最新的代码。
- git status:查看工作区和暂存区的状态。
- git log:查看提交历史。
- git branch:查看分支列表。
- git checkout [branch]:切换到指定分支。
- git merge [branch]:将指定分支合并到当前分支。
- git stash:将当前工作区的修改保存到一个临时存储区,以便切换分支或恢复之后再应用。
- git reset [commit]:撤销指定提交,并将修改移动到暂存区。
- git remote add [name] [url]:添加一个新的远程仓库。
- git remote -v:查看远程仓库的详细信息。