Skip to main content

Chapter 6 - Creating a New Project

Setting up the Project

SF Cli Project

  1. Open VSCode and navigate to the folder where you want to create the Project - presumably somefolder/sfdx_projects or equivalent
  2. Use CTRL+SHIFT+P to open the VSCode Command Panel and type SFDX, then select SFDX:Create Projectimage-1747666376973.png
  3. Select empty then type the name of your project and type Enter.
  4. This will create a new SF Project. VS Code will ask if you want to open the folder - say yes.
  5. You should now have the VScode Project open.
  6. Select the Source tracking tab of VS Code and click "Initialize Repository"image-1747666402096.png
  7. Go to Bitbucket and create a repository.image-1747666544493.png Make it "empty" and refuse to add a GitIgnore.
  8. Copy the URL given by Bitbucket in the format  https://[email protected]/MYWORSPACE/MYREPO.git which should be displayed in the screen.
  9. Select the three dots at the top right of the leftmost panel, then click "Add Remote"image-1747666472757.png
  10. Paste the URL, select "Add Remote from URL". When asked for the remote name, type origin then press enter. 
  11. At the bottom right, click yes on "Run Fetch periodically".image-1747666788937.png
  12.  run git push --set-upstream origin main in the VSCode Terminal to sync your local and remote branches.

Fetch your Salesforce Metadata

  1. Login to your Salesforce org. This can be done using CTRL+SHIFT+P Authorize an Org, or running sf org login web --alias MyOrg in the terminal where MyOrg is the name you want to give to the org.
  2. Run sf project retrieve start --target-org MyOrg --ignore-conflicts --wait 20
  3. Commit the state of the project and push

Continue working