Using the first-principles method based on density functional theory, we have studied the structural properties of GaN with wurtzite, zinc-blende and rocksalt structures and the phase transition of GaN under high pressure. According to the isoenthalpy principle, the phase transition pressure from zinc-blende structure to rocksalt structure of GaN is about 41.9GPa, which is consistent with the experimental results and other theoretical results. Employing the quasi-harmonic Debye mode, we have calculated the relationships between the thermal expansion coefficient and the pressure of GaN with zinc-blende structure and rocksalt structure at different temperatures. The relationships between the volume and pressure at different temperatures, and those between the heat capacity and temperature under different pressures are also obtained.