Arc Forumnew | comments | leaders | submitlogin
2 points by Pauan 4923 days ago | link | parent

Yeah, sorry, that was intentional, but I didn't realize the links would break. In hindsight, I should have.

Well, it's pretty simple[1], really. I used git fetch upstream to grab all the changes from ar. Then I used git reset --hard to reset my master branch to ar's branch, completely destroying everything on my branch, including commits.

Then I used git push -f to force my changes onto GitHub. Voila, now my fork is in the exact same state as ar. Of course, before I did all that, I created the old branch, so I wouldn't lose my work. Here's roughly what I did:

  git branch old
  git push origin old
  ... do stuff ...
  git fetch upstream
  git reset --hard 2be9ac75f67edfe9b3c43a9515dd78acebba6f1c
  git push -f origin
At least, I think that's what I did. I actually had to experiment and mess up some stuff before I figured out how to do it. So my directions may be wrong and you may bork your repo!

By the way, while I was trying to do that, I found this: http://stackoverflow.com/questions/772846/create-git-branch-...

But their directions are somewhat different from mine. I don't think I needed git pull for instance, and git push origin :master didn't work for me. So I had to use -f to force the push, since git was kindly telling me that it might destroy my commits (which I wanted to do).

---

After using git for a while, I gotta say, I like it a lot more than Mercurial. git gives you the power to do stuff, whereas Mercurial seems to hold your hand a lot more, and say, "no I can't let you do that, Dave"

Now, I'm not saying Mercurial is bad, just that I like the raw power of git, in the same way that I like the raw power of Arc. So for me personally, git seems to be the winner.

---

* [1]: s/simple/obtuse black magic/



2 points by rocketnia 4923 days ago | link

Thank you so much. ^_^ Between that, http://book.git-scm.com/1_the_git_object_model.html, and http://blog.nelhage.com/2010/01/git-in-pictures/, Git's starting to make more sense.

It's too bad the links break. But wait, the pull requests' links don't break, because they link directly to the blobs.... I bet the blobs will stick around as long as at least some branch points to them, so playing fast and loose with lots of branch-renaming is only going to hurt tip-of-branch links. Too bad GitHub doesn't have some way to specify redirects (or at least I think it doesn't).

-----