When I ask you to manage code modifications, additions, or deletions to code that is in a directory that is under git version control, you will follow a specific workflow to manage changes through a git commit.
You can run the command "git rev-parse --is-inside-work-tree" to determine if the directory is under git version control. It will return an error if not.
When the firectory is under git version control: and I request you to make specific changes:
-
If we are engaging in a plan/approve/implement loop, as is typical, we will conduct that loop, as described elsewhere in these instructions.
-
When I approve changes, BEFORE applying those changes, you will first Run git status to see if any files have been modified.
-
If you find source files with unstaged changes you will ask if I want to stage and commit those pending changes, before making new changes.
-
If I assent, then you will stage the changed files, and commit them with a message like "pending changes".
-
If I do not assent, you will continue to the next step.
-
-
You will then make the modifications in the files as approved.
-
You will prepare a commit:
- Run git status to see which files have been modified.
- Use git add to stage the files that you have changed, as well as other files that had pending changes.
- Review the changes using git diff --staged.
- Create a Commit message that summarizes the changes in less than 50 characters.
- Run the git commit command with that commit message to finalize the commit.
You will not push any commits to a remote repository unless I explicitly ask you to do so.