sfdx - is it possible to pull or push one file instead of all the files

Looks like this should be an idea under idea exchange for the salesforce DX Product team. Currently don't think you can push one file and there are no commands supporting this. Salesforce DX is just not designed that way at this point although sounds like having a local staging like git to add and commit makes sense.

Update

You can now use sfdx force:source:deploy command to push one file. However, the key thing to note here these commands won't have source tracking built into them.


Yes. Use the deploy command to push:

sfdx force:source:deploy -p "/PATH/TO/YOUR/COMPONENT"

Use the retrieve command to pull:

sfdx force:source:retrieve -p "/PATH/TO/YOUR/COMPONENT"

If the component doesn't exist on your local you have to get it via metadata, for example:

sfdx force:source:retrieve -m "ApexClass:YOURAPEXCLASS"

Note the name of the metadata is the API Name, not the filename. To get all files of a certain metadata type:

sfdx force:source:retrieve -m LightningComponentBundle

Although surrounding your path or metadata name with quotes is optional, you will have to include them if you have any spaces in the names.