You have two choices. First, you can use force:package commands to create an unlocked package. You can install this in production with force:package:install; it is similar to installing an AppExchange package. Otherwise, you would need to use force:source:convert to get a mdapi style format, then use force:mdapi:deploy with the relevant test level (e.g. RunLocalTests) and set rollbackOnError to true. Check out the Salesforce CLI Reference for specific details, or sfdx help force:<command>
for command-level help direct from the console. I do not believe that you're currently allowed to create unlocked packages directly via the GUI, but you can open a terminal by using the Terminal > Create New Terminal option, which will open a sfdx environment by default.
GIT: Clone on VS Code. Directory selected ../Documents/Demo-Project/force-app. A folder named remote-project is created with the source content from bitbucket. Got a pop up asking for Open Repository and Add to Workspace. I clicked on Add to Workspace.
This is your issue. You're creating an SFDX project, and then cloning a different SFDX project inside it. When you complete this step, your directory tree probably looks like this:
Demo-Project/
force-app/
main/
default/
aura/
remote-project/
.git/
aura/
democmp/
Only the folder enclosing .git
and its descendants are part of the Git repository, because that's where you chose to clone it. Git cannot see anything outside the repo boundary, so anything that is saved in main/default/aura/
isn't part of the repo and isn't visible to Git.
Conversely, you've told Visual Studio Code, by creating an SFDX project, that you want to be working in an outer directory tree rooted at force-app
. If you look in your sfdx-project.json
file, you should see something like
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
This tells VSC that your project's primary source directory is under force-app
(not remote-project
), and that's where your SFDX commands are going to save and push source from by default.
If you're starting from an existing SFDX project that's stored in a source code repo, which sounds like it's the case although I suspect something's a little off about the way you're discussing the folder tree, you probably want to just clone that project and then open its root folder in Visual Studio Code, rather than creating a new project locally first.
Best Answer
The issue you are seeing is related to the recently published version v55.4.0 of the Salesforce Extension for VS Code.
Multiple users are impacted by this.You can follow https://github.com/forcedotcom/salesforcedx-vscode/issues/4261 for updates.
The workaround for now, would be to downgrade the "Salesforce CLI Integration" extension version.
I will keep this thread updated as I have more inputs from our concerned Salesforce product development team.
Update: As a fix, v55.4.1 of the Salesforce Extension for VS Code has been published. See the release notes here: https://github.com/forcedotcom/salesforcedx-vscode/releases/tag/v55.4.1