1. He got onto the ship.

2. He got on the ship.

3. He went onto the ship.
4. He went on the ship.

------------------------
What is the difference betwen them?
Which ones are grammatical? Are they the same in meaning?

Not much difference at all. Either phrasing works fine.