Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the git equivalent for a specific version checkout, like "svn checkout -r 123 <svn_rep_url>"

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

like image 552
Subhranath Chunder Avatar asked Jan 31 '26 02:01

Subhranath Chunder


1 Answers

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.

like image 191
VonC Avatar answered Feb 03 '26 06:02

VonC