I'm pulling down change sets into my IDE using sfdx force:source:retrieve -n 'my changeset name' and it puts the files in a 'my changeset name'. Is there a way to specify the name of the folder, or automate the nameing with a date/time stamp?


Not directly in sfdx, no. The folder name is how the API determines which "package" (in your case, the change set) to update when you deploy. A simple shell script could do the trick though:

sfdx force:source:retrieve -n "my changeset name"
mkdir "$TEMPDATE"
mv "my changeset name" "$TEMPDATE"

Alternatively, consider using a git repository. This is more efficient in terms of disk space, and you pretty easily navigate your changes via branches/commits.

| improve this answer | |

Currently, there is no such functionality to allow you to specify the directory where you want to retrieve it. It is hardcoded in the CLI code so if you need to enhance this, file an enhancement request here

I have built an sfdx plugin that allows for this flexibility. You can check here

To get started with this here is all you need to do,

sfdx plugins:install mo-dx-plugin

And then use the below command

sfdx retrieve:dxsource -n <package/changeset> -p <[pathName]>

use -p to specify the directory where you want to retrieve it.

| improve this answer | |
  • 2
    +1 Of course you'd have thought of this. I keep forgetting how absolutely awesome your plugin is. – sfdcfox Jun 5 at 14:31
  • 2
    @sfdcfox Thank you 😊 . I will be updating some more security patch and fixes for it this weekend and excited about it. Should make apex saving much better especially during inserts :) – Mohith Shrivastava Jun 5 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.