On Wed, Jan 06, 2010 at 06:34:37AM -0800, Trans wrote:
> On Jan 6, 9:20 am, "Michael P. Soulier" <msoul...@digitaltorque.ca>
> wrote:
> > On 05/01/10 Trans said:
> >
> > > So I've cloned a repo, which is a fork of another repo. If I want to
> > > update my repo to match the original (and ditch any changes I may have
> > > made), how do I do it?
> >
> > Did you follow any workflow guidelines and make your changes on separate
> > branches from master? If not your simplest option is to delete your cloned
> > repo and reclone it.
> I am using github. So I have my own fork. So it's more involved then
> that. I would have to delete my fork, then refork it and then reclone
> it. I was hoping for a simple way to update my repo without having to
> do all that.

1. git remote add upstream git://github.com/upstream/project.git
2. git fetch upstream
3. git reset --hard upstream/master
4. git push origin +master

1. Add a reference to the repo you forked from
2. Fetch its branches
3. Reset your current branch so that it equals upstream's master
   branch.  Careful, this will ditch any and all changes you've
4. Push your master branch to your fork (origin).
   The "+" tells it to force the push in case you maybe have
   pushed stuff before and truly want to ditch it.
   Try it without the "+" first since if you haven't pushed
   anything it isn't required (forcing things is bad, in

At that point you your fork's master branch will be equivalent
to upstream's master.

Have fun,

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to