Hi Ahanu,
I would split things out into some variables, and put the articulations into separate contexts. I find it makes things much easier to keep track of. For example:
\version "2.24.0"
\language "english"
music = { g8 g g g }
upArticulation = { g8 g-\upbow g g }
downArticulation = { g8 g-\upbow g g }
<<
\new Dynamics
\upArticulation
\new Staff
\music
\new Dynamics
\downArticulation
>>
In a Dynamics context the entered music gives the durations, but the note heads aren't printed. So once the music is entered and checked, it can just be pasted into a new variable and the articulations added as needed.