5

I want to get the OpenCV2.4.2 source files for windows in order to generate the libraries myself. I run the command

git clone git://code.opencv.org/opencv.git

This actually gets the 2.4.9 repository which I don't want. There is a GIT option

git reset --hard <commit code>

that is supposed to get back to the desired commit. The thing is that I found that there are way too many commits and I don't know which one is the version 2.4.2!

  • How can I download version 2.4.2 from GIT?
Zoe
  • 27,060
  • 21
  • 118
  • 148
Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
  • check this http://stackoverflow.com/a/1655666/1225337 – Nikson Kanti Paul Sep 13 '12 at 08:14
  • very interesting. But still there is the problem on how to know which id corresponds to version 2.4.2 – Jav_Rock Sep 13 '12 at 08:17
  • @Jav_Rock try to issue `git tag` to get tag name of version, then issue `git checkout tagname` – om-nom-nom Sep 13 '12 at 08:18
  • 1
    Great news to hear OpenCV migrated from SVN to git! Every time when a branch was created in SVN, it took me almost one day to run `git svn fetch` and slowed down my PC! With git, this will no longer be a problem of slow fetch. – linquize Sep 13 '12 at 09:37
  • @linquize If opencv has migrated to **Git**, then we all should migrate to **Git**! – Jav_Rock Sep 13 '12 at 11:25

1 Answers1

7

Just look for the tags using:

git tag

Look for OpenCV 2.4.2, or whatever you want, and then checkout with your election:

git checkout 2.4.2 

in your case.


If you want to pull the latest 2.4 branch, then you can do:

git clone -b 2.4 --single-branch https://github.com/Itseez/opencv.git Opencv-2.4
iNFINITEi
  • 1,504
  • 16
  • 23
goe
  • 2,272
  • 1
  • 19
  • 34