What did dinosaurs evolve from? Was it the reptiles that evolved from amphibians? I have been researching this but am very confused with who their direct predecessor was. Amphibians evolved from fish...reptiles from amphibians...dinosaurs from reptiles (?)...and birds from dinosaurs. That is my understanding, but it could be wrong. How are dinosaurs related to reptiles? And if they did evolve from reptiles, which kind of reptiles (such as lizards, crocodiles, or turtles for example)?
1$\begingroup$ Related: If dinosaurs could have feathers, would they still be reptiles? $\endgroup$– Remi.bAug 17, 2017 at 4:11
Source of information
See the post The best free and most up to date phylogenetic tree on the internet? for info about how to find such information.
Generally speaking, you might be interested in an intro to phylogenetics such as the one provided in this answer for example.
Where are dinosaurs in the tree of life?
Dinosaurs fall within the Reptiliomorpha clade. Please note that Reptiliomorpha does not quite correspond to what we today call reptiles. Please see the post If dinosaurs could have feathers, would they still be reptiles?
Reptiliomorpha is the sister clade to Amphibia (from here) which contain all living amphibians.
If you look within the Amniota, you will find all of the following
Here, you see that turtles and mammals are an off-shoot of Diapsida. So dinosaurs are not mammals and there are not closely related to turtles. Now if you click on Diapsida you will find ...
the Archosauromorpha which contains all crocodiles, birds and dinosaurs. You can keep going to find Therapoda which contains many dinosaurs and birds. You can keep going like this for yourself and discover the entire tree of life!
Reacting to your sentences
What did dinosaurs evolve from?
When asking this question, please do not forget that no species evolved from an extant species. If this is unclear to you, you should have a look at this post.
Was it the reptiles that evolved from amphibians?
Well... the term reptile is a mess because it does not represent a monophyletic group (see this post). If you do not understand the term monophyletic, then you should have a look at this answer.
Amphibians evolved from fish...
Well... sure. However, fish is also not monophyletic so it is misleading. Also, I am afraid when you say "Amphibians evolved from fish" that you are thinking of modern extant fish which would be wrong.
reptiles from amphibians...
Nope, this is wrong. Reptiles and amphibians are sister(-ish) clades.
dinosaurs from reptiles (?)...
This is more or less true although again, do not think of modern reptiles and also, reptiles is a mess because it is not a monophyletic group. But Dinosaurs are Reptilia
and birds from dinosaurs.
Yes, this is pretty much true.
Note generally though that it is misleading to say "birds evolved from dinosaurs", "humans evolved from apes" and "mammals evolved from vertebrates". It is more correct to say "birds are dinosaurs", "humans are apes" and "mammals are vertebrates". I would be even better to use the latin names to avoid confusion with misuse of these words in the popular culture.
1$\begingroup$ Nice answer!... $\endgroup$ Aug 17, 2017 at 17:00
$\begingroup$ When you say no species has evolved from an extant species, why is that? Wouldn't the Galapagos finches have evolved from an extant species of finch in South America? Meaning that they did indeed evolve from an extant species? (I did read the linked post, but I am still a bit confused) $\endgroup$– HawkeyeAug 18, 2017 at 1:14
1$\begingroup$ @Remi.b If I am understanding the linked posts correctly: No species has evolved from an extant species because the species has also been evolving and is now different, no matter how slight. Am I thinking of that correctly? $\endgroup$– HawkeyeAug 18, 2017 at 1:41
$\begingroup$ @Hawkeye Yep pretty much! Good job! $\endgroup$– Remi.bAug 18, 2017 at 1:43
If you check wiki you can find that dinosaurs evolved in the clade of Archosaurs. Crocodiles and birds are still living representatives of the Archosaurs. The most recent common ancestor of birds and crocodiles, was also the ancestor of the dinosaurs and was a reptile.