Terminal Git tracking vs VS Code git tracking is not in sync

Viewed 797

When I add, modify OR delete files from Terminal (I am using iTerm2 -oh my zsh- git extension) stage them and commit them it doesn't reflect in my VS code git tracking.

My source control section in VS code still says that changes are not staged OR tracked with git.
And I have to stage and commit them again.

When I open terminal in VS code and check git config --list, both iTerm2 terminal and VS code terminal shows same list of configuration.

Also log and history is also same when I check from both individual terminals.

It's just when I stage OR commit from either of my iterm2 terminal OR from VS Code, they both don't consider changes are staged OR committed if other terminal did, and still shows untracked OR not committed of each others.

Did any one face such issue before? Is anything to do with VS Code Git settings or so?

See screenshot exact error i am mentioning

1 Answers

Did any one face such issue before?

No, and if you actually make another commit with VSCode, after making one with iTerm2, there is no way, the git log would show you identical commits (SHA1), since part of a commit metadata is its creation date.

Try and add GitLens, to see more information on your local Git repository.

Check also for any GIT_xxx environment variable (like ones regarding Repository location -- GIT_DIR, GIT_WORK_TREE) which might explain why a Git repository is not seen by default.

Related