Huh, I've never done anything like that. Never had a pattern that called for it. But I tired it and here is what I did. I'm assuming there are an even number of stitches (but this works with an odd number too, but has to be adjusted). Knit the first stitch on a needle, knit the second stitch on a different needle, and keep alternating across. Tricky to do, and yarn overs easy to get if you aren't careful.
This makes the first stitch that was in the original row end up on one needle and the yarn ends up attached to the other needle. I just kept working with the needle that the yarn was attached to at the moment and left the other needle dangling as a holder (put a stitch protector on the end of it if you can so the stitches won't fall off). I don't know what stitch you are using but I just used St st so my first row was a purl row. (If you don't have enough needles to do this you can slip the stitches on the needle with no yarn onto a holder or waste yarn.)
Knit that needle up for your 2 inches. Ending with a purl row (count your rows so you can make the other needle have the same number). Cut the yarn and rejoin it to knit the other needle. Begin with WS facing and work a purl row first. Work it the same number of rows as the first needle. End on a purl row.
Now comes the rejoining row. Knit the first stitch on the needle the yarn is attached to (this was the original 1st st in the row), then the first stitch on the other needle on to join it. Keep alternating needles until all the stitches are on one needle.
Be sure that the first stitch you knit there at the end to get them all back on the needle was the stitch which, running back to when you started this maneuver, was the first stitch in the row. In other words keep the stitches in order.
You don't need to work in the ends until you are all done with the project.