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
相关推荐
2501_915374353 小时前
git 查看用户信息
git
palomua10 小时前
Git Updates were rejected because the remote contains work that you do not
git
不知名。。。。。。。。16 小时前
Linux—— 版本控制器Git
linux·运维·git
JJ1M817 小时前
Git技巧:Git Hook,自动触发,含实战分享
git·python·自动化
服部20 小时前
如何查看指定作者在所有分支的提交记录
前端·git·github
大卫小东(Sheldon)1 天前
使用DVC管理大文件变更历史(基于git)
git
晓龙的Coding之路1 天前
如何通过git删除某个文件的历史提交记录
git·git删除指定文件log
手可摘星Chen1 天前
commitlint安装和配置使用教程
前端·git
曾经的三心草1 天前
Git-基本操作
大数据·git·elasticsearch
i_am_a_div_日积月累_1 天前
git检查提交分支和package.json的version版本是否一致
git·json