Porosity, which occurs in products made of aluminum-magnesium alloys synthesized by wire-arc surfacing, significantly worsens the characteristics of fatigue strength. The developed technology of hybrid additive manufacturing with layer-by-layer forging of each deposited layer of material is able to minimize the porosity of the product. To select the rational parameters of the technological process, the evolution of the porosity distribution over the cross-section of a linear element after its single forging with a pneumatic hammer is investigated. A numerical model of the process is constructed in the LS-DYNA® package, where the Gurson–Tvergaard–Needleman relations are taken as constitutive equations of plastic deformation of the material and porosity evolution. To determine the parameters of the Johnson–Cook hardening law, tests of the AMg6 alloy were performed in a wide range of strain rates. The impact of the pneumatic hammer in the numerical model was calibrated using an accelerometric and strain-gauged steel target, as well as by distortions of the cross-section of a forged bar made of AMg6 alloy. Calculations according to the model are compared with experimental data, for which two linear segments were made by additive manufacturing with and without layer-by-layer forging, from the cross-sections of which the slots processed for pore visualization were prepared. With this method of pressure treatment, the decrease in porosity in the boundary layer of the workpiece mainly depends on the accumulated plastic deformations and does weakly sensitive the appearance of a stressed state. The model allows you to predict the size of the area under the hammer head depending on the processing mode, within which the porosity is eliminated by forging. The use of such modes will ensure the manufacturing of products without residual porosity in the processes of additive manufacturing by surfacing with layer-by-layer forging.