pull拉取最新代码

工作区、暂存区、版本库

工作区:就是你在电脑里能看到的目录。

暂存区:英文叫 stage 或 index。一般存放在 .git 目录下的 index 文件(.git/index)中,所以我们把暂存区有时也叫作索引(index)。

版本库:工作区有一个隐藏目录 .git,这个不算工作区,而是 Git 的版本库。

本地仓库的代码还未被更新,此时:

(1) 更新远程仓库的代码为最新的

复制代码
git fetch --all

(2) 让本地代码与origin / master完全相同

复制代码
git reset --hard origin/master

(3) git pull拉取远程代码

复制代码
git pull origin master

(4) git merge将暂存区代码更新到本地工作区

复制代码
git merge master
相关推荐
北极糊的狐1 小时前
钉钉小程序 Git 版本管理完整流程
git·小程序·钉钉
Fzuim10 小时前
当 AI 也成为提交者:ThinkFlow 的 Git 提交规范,是怎么定的
git·agent·thinkflow
CodexDave1 天前
数据库连接池耗尽:排查顺序与三层兜底
服务器·前端·数据库·git·云原生·容器·kubernetes
乐观的Terry1 天前
5、发布系统-Git 集成
大数据·git·elasticsearch
不怕犯错,就怕不做1 天前
GIT的简单打patch应用format-patch and git am
linux·git·全文检索
Byron Loong1 天前
【Git】如何检查 Ubuntu 系统上 gitLab 是否开启
git·ubuntu·gitlab
lar_slw1 天前
git删除上一次提交
git
leoZ2312 天前
Git 集成实战完全指南(四):Git 冲突解决
大数据·git·elasticsearch
枫荷2 天前
Git LFS 大文件优化说明
git
techdashen2 天前
不用再反复 stash:用 Git Worktree 同时开发多个分支
大数据·git·elasticsearch