计算机毕业设计 | SpringBoot+vue学生网上请假系统 高校教务管理系统(附源码+论文+开题报告)
2026/4/28 7:13:29
git add后)→ 版本库(.git目录,git commit后);git config --global user.name "你的用户名" # 关联远程账号 git config --global user.email "你的邮箱" # 关联远程邮箱 git config --global core.quotepath false # 解决中文乱码git init # 本地新建仓库 git clone 远程地址 # 克隆远程仓库(HTTPS/SSH)git status [-s] # 查看文件状态(-s 简洁版) git add 文件名/. # 暂存文件(. 表示所有) git restore --staged 文件名/. # 撤销暂存 git restore 文件名/. # 撤销工作区修改 git rm 文件名 # 删除文件(并暂存)# 规范提交格式:type(scope): 描述(type:feat/fix/docs/style/refactor/test/chore) git commit -m "feat(login): 新增验证码功能" git commit -am "fix: 修复登录跳转bug" # 跳过暂存,直接提交已追踪文件git log --oneline # 简洁查看提交历史(哈希+描述) git reflog # 查看所有操作记录(含回退/撤销)git branch # 查看本地分支(* 为当前分支) git branch -r # 查看远程分支 git checkout -b 分支名 # 新建并切换分支 git checkout 分支名 # 切换分支 git checkout -f 分支名 # 强制切换(忽略未提交修改) git merge 目标分支 # 合并目标分支到当前分支 git branch -d/-D 分支名 # 删除本地分支(-D 强制删) git push origin --delete 分支名 # 删除远程分支git remote -v # 查看关联的远程仓库 git remote add origin 远程地址 # 关联远程仓库 git push -u origin 分支名 # 首次推送(绑定追踪关系) git push # 后续推送(已绑定) git pull # 拉取远程代码并合并 git fetch origin 分支名 # 拉取远程代码不合并git reset --hard 版本哈希 # 硬回退到指定版本(删除后续修改) git revert 版本哈希 # 撤销指定提交(保留历史,推荐) git reset --hard HEAD~n # 回退到前n个版本(如HEAD~1:前1个)ssh-keygen -t rsa -C "邮箱"→ 复制公钥到远程仓库(GitHub/Gitee);git stash(暂存)→git stash pop(恢复并删除暂存);node_modules/、.env)。<<<<<<</=======/>>>>>>>标记,保留正确代码,git add .→git commit;git pull拉取远程最新代码,解决冲突后再git push;git branch -a确认正确分支名,再切