I'm working on a script that monitors a repository by running a git status
and searching for the text "Your branch is behind". If it finds it, it pulls the changes and does a build.
It seems to work well, but it's not super easy to test. I have tested with a test repo where I just edit a text file from another machine and push it, but now I want to test end-to-end with the real code.
Is there any way to put my local repo folder in a state that would simulate a status result of "Your branch is behind"? I tried checkout of a previous commit hash but then I just get a detached head.