Skip to content

Instantly share code, notes, and snippets.

@justin-lyon
Last active March 5, 2020 21:39
Show Gist options
  • Save justin-lyon/11e4c229f02a5649a617c2c620f35979 to your computer and use it in GitHub Desktop.
Save justin-lyon/11e4c229f02a5649a617c2c620f35979 to your computer and use it in GitHub Desktop.
Setup version control and a sandbox for a trailhead.

Version Control Trailheads

I'm starting a new Trailhead and I want to track it in version control.

Requirements

  1. Git Installed
  2. Salesforce CLI Installed

On the web

Create a new Dev Edition sandbox and a new GitHub repo for your trailhead.

  1. Sign up for new Dev Edition Sandbox
  2. Activate My Domain in your Dev Edition Sandbox
  3. Create new GitHub Repository
  4. Copy the CloneURL.git

On your device

Open the folder that will contain your work. I usually do this in a folder called workspace.

  1. Right Click in your workspace folder and click Git Bash Here
  2. git clone <your-repo-clone-url.git>
  3. cd your-repo-name
  4. sfdx force:project:create -n . -t empty -x
  5. git add .
  6. `git commit -m "initial commit"
  7. git push
  8. sfdx force:auth:web:login -dsa <my-sandbox-alias> -r https://<my-domain>-dev-ed.my.salesforce.com
  9. sfdx force:source:retrieve -x manifest/package.xml
  10. git add .
  11. git commit -m "add initial sandbox retrieve"
  12. git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment