This paper investigates streaks and Görtler vortices in a boundary layer over a flat or concave wall in a contracting or expanding stream, which provides a favourable or adverse pressure gradient, respectively. We consider first the excitation of streaks and Görtler vortices by free stream vortical disturbances (FSVD), and their nonlinear evolution. The focus is on FSVD with sufficiently long wavelength, to which the boundary layer is most receptive. The formulation is directed at the general case where the Görtler number $G_{\Lambda }$ (based on the spanwise length scale $\Lambda$ of FSVD) is of order one, and the FSVD is strong enough that the induced vortices acquire an $O(1)$ streamwise velocity in the region where the boundary layer thickness becomes comparable with $\Lambda,$ and the vortices are governed by the nonlinear boundary region equations (NBRE). An important effect of a pressure gradient is that the oncoming FSVD are distorted by the non-uniform inviscid flow outside the boundary layer through convection and stretching. This process is accounted for by using the rapid distortion theory. The impact of the distorting FSVD is analysed to provide the appropriate initial and boundary conditions, which form, along with the NBRE, the appropriate initial boundary value problem describing the excitation and nonlinear evolution of the vortices. Numerical results show that an adverse/favourable pressure gradient cause the Görtler vortices to saturate earlier/later, but at a lower/higher amplitude than that in the case of zero-pressure-gradient. On the other hand, for the same pressure gradient and at low levels of FSVD, the vortices saturate earlier and at a higher amplitude as $G_{\Lambda }$ increases. Raising FSVD intensity reduces the effects of the pressure gradient and curvature. At a high FSVD level of 14 %, the curvature has no impact on the vortices, while the pressure gradient only influences the saturation intensity. The unsteadiness of FSVD is found to reduce the boundary layer response significantly at FSVD levels, but that effect weakens as the turbulence level increases. A secondary instability analysis of the vortices is performed for moderate adverse and favourable pressure gradients. Three families of unstable modes have been identified, which may become dominant depending on the frequency and streamwise location. In the presence of an adverse pressure gradient, the secondary instability occurs earlier, but the unstable modes appear in a smaller band of frequency, and have smaller growth rates. The opposite is true for a favourable pressure gradient. The present theoretical framework, which accounts for the influence of the curvature, turbulence level and pressure gradient, allows for a detailed and integrated description of the key transition processes, and represents a useful step towards predicting the pretransitional flow and transition itself of the boundary layer over a blade in turbomachinery.