Git拉到特定的提交 [英] Git pull till a particular commit

查看:68
本文介绍了Git拉到特定的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做一个git pull,但只做到特定的提交为止.

I want to do a git pull but only till a specific commit.

 A->B->C->D->E->F (Remote master HEAD)

,所以假设我的local master HEAD指向B,并且我想拉到E.我该怎么办?

so suppose my local master HEAD points to B, and I want to pull till E. What should I do ?

这不是拉特定的提交,这是拉特定的提交.

This is not pulling a specific commit, this is pulling upto a specific commit.

推荐答案

git pull只是git fetch,后跟git merge.所以你可以做的是

git pull is nothing but git fetch followed by git merge. So what you can do is

git fetch remote example_branch

git merge <commit_hash>

这篇关于Git拉到特定的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆