Quantcast

how to reset to remote repo

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to reset to remote repo

bill lam
I cloned some public git repos and made some local patches. Later I
pulled updates again and that merged with my patches. Now I want to
throw away my patches, how do I get a clean working repo that is a
100% clone of the remote repo?

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩285 張祜  集靈臺二首之二
    虢國夫人承主恩  平明騎馬入宮門  卻嫌脂粉污顏色  淡掃蛾眉朝至尊
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to reset to remote repo

Dilip M
git reset --hard HEAD

-- BR, Dilip




On Mon, Feb 23, 2009 at 4:25 PM, bill lam <[hidden email]> wrote:

> I cloned some public git repos and made some local patches. Later I
> pulled updates again and that merged with my patches. Now I want to
> throw away my patches, how do I get a clean working repo that is a
> 100% clone of the remote repo?
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> 唐詩285 張祜  集靈臺二首之二
>    虢國夫人承主恩  平明騎馬入宮門  卻嫌脂粉污顏色  淡掃蛾眉朝至尊
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to [hidden email]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to reset to remote repo

Sitaram Chamarty
In reply to this post by bill lam
On 2009-02-23, bill lam <[hidden email]> wrote:
> I cloned some public git repos and made some local patches. Later I
> pulled updates again and that merged with my patches. Now I want to
> throw away my patches, how do I get a clean working repo that is a
> 100% clone of the remote repo?

git reset --hard origin/master

This is a very simple question, and may be quicker on irc
:-)

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to reset to remote repo

bill lam
On Mon, 23 Feb 2009, Sitaram Chamarty wrote:
> git reset --hard origin/master
>
> This is a very simple question, and may be quicker on irc
> :-)

Does it always work?  For example if I already made several patches
interleaved with several fetch/update, or if I rebase to remove the
orgin/master?

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩286 張祜  題金陵渡
    金陵津渡小山樓  一宿行人自可愁  潮落夜江斜月裡  兩三星火是瓜州
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to reset to remote repo

Sitaram Chamarty
On 2009-02-23, bill lam <[hidden email]> wrote:
> On Mon, 23 Feb 2009, Sitaram Chamarty wrote:
>> git reset --hard origin/master
>>
>> This is a very simple question, and may be quicker on irc
>> :-)
>
> Does it always work?  For example if I already made several patches
> interleaved with several fetch/update, or if I rebase to remove the
> orgin/master?

I'm not sure why a rebase of any kind would remove a remote
brancg but you can always do 'git fetch' first if you
accidentally messed up origin/master.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to reset to remote repo

bill lam
On Mon, 23 Feb 2009, Sitaram Chamarty wrote:
> I'm not sure why a rebase of any kind would remove a remote
> brancg but you can always do 'git fetch' first if you
> accidentally messed up origin/master.

Thanks. Incidentally I just found that I could git reset just before
my first patch and then git pull again.

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩226 王維  送別
    山中相送罷  日暮掩柴扉  春草明年綠  王孫歸不歸
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Loading...