Pipe cleaning is a common operation in the oil and gas industry. In this paper, the governing equation of the pipeline inspection gauge (PIG, lowercase pig is commonly used) speed is combined with the gas flow equations. The method of characteristics (MOC) is used to solve the transient equations of gas flow. And the process of a pig passing over an uphill section of a gas pipeline is simulated. The results indicate that a pig may get stuck in uphill gas pipeline, due to the coupling of the gas and the pig. Under these circumstances, a higher pressure of the upstream could be helpful for driving the pig in motion. Additionally, the ratio of inlet pressure rise during the pigging process is primarily determined by the inclination of the uphill section. In addition, a formula to predict the inlet pressure during pigging in an uphill pipe is presented. Furthermore, the proposed method and solution can be utilized to predict the speed and position of the pig, as well as the gas pressure and the stoppage of the pig in hilly gas pipelines.