trypear / pearai-app

An Open Sourced AI-Powered Text Editor. A fork of VSCode and Continue.
https://trypear.ai
Other
528 stars 86 forks source link

Make submodule folder be clean and have latest updates upon first cloning repo #113

Closed Fryingpannn closed 1 month ago

Fryingpannn commented 1 month ago

Before, when first cloning repo, would have merge conflicts when the scripts goes into submodule folder and tries to pull. This is because the submodule is initialized to a specific commit instead of main. What we can do is once this submodule initializes to a specific commit, we force it to checkout to main, and remove all directory and staged changes, to match with origin/main. Then the submodule would be the latest upon first install.

Tested by

  1. Removed everything in submodule rm -rf extensions/pearai-submodule/{*,.*}
  2. Running ./scripts/pearai/setup-environment.sh to setup

No merge conflicts, no additional changes. Submodule initialized with latest origin/main changes.