把git回购做一定的修改 [英] bring git repo up to a certain revision

查看:111
本文介绍了把git回购做一定的修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个git repo,并且我想让它获得我的本地克隆的修订代码。我怎样才能把它带到一个特定的版本,并摆脱我所做的任何更改?

解决方案

想要惹恼。在日志中找到你想要的版本,然后执行:

  $ git reset --hard abcd93 

code>

使用 abcd93 即可找到您在日志中找到的任何版本。请注意,这将改变分支指针。



通常最好产生一个新的分支,所以考虑

  $ git checkout abcd93 -b new_branch_name 


I have a git repo, and a revision code I want it to get my local clone to. How can I bring it up to a specific revision and get rid of any changes I've made?

解决方案

Checkout the branch you want to mess with. Find the revision that you want in the log, then do:

$ git reset --hard abcd93

With abcd93 being whatever version you found in the log. Note though, that this will change the branch pointer.

It is usually best to spawn off a new branch, so consider

$ git checkout abcd93 -b new_branch_name

这篇关于把git回购做一定的修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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