Assuming you've correctly initialized the ifstream and you've opened a file, the second one would be most correct.
The istream class provides a getline member function as well but it only accepts char *: http://www.cplusplus.com/reference/istream/istream/getline/
What you're looking for is http://www.cplusplus.com/reference/string/string/getline/ which is a part of the string header. To be quite honest, I'm ignorant of what the standard says is the difference between the two as far as result and consequence goes.