3

What would be the closest git command equivalent to a svn command: "svn checkout -r 123 "?

1 Answers1

3
git checkout -b myBranch <SHA1_for_r123>

You would update your working tree with the right SHA1 revision, while creating a branch in order to isolate any new commit you will make in that branch.

If you only did:

git checkout <SHA1_for_r123>

you would end up in a detached HEAD mode.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @eckes: thanks :) I actually completed the answer since you made that vote. – VonC Apr 21 '11 at 09:10
  • @VonC It looks like you are racking up points at roughly 2k a week. I could have sworn you were on 477k when you answered my last query. At this rate there will be no points left for the rest of us very soon :) – vfclists Mar 23 '15 at 18:11
  • @vfclists that's what is neat with Stack Overflow: there will *always* be more than enough points for everybody else :) – VonC Mar 23 '15 at 18:19