That’s pretty much how I have developed some custom components in the past.
Another option is to make your custom component repository compatible with HACS and deploy it through by adding it manually or publish it via HACS. (Example)
With my cookiecutter or using directly the Integration Blueprint you can manage the development of a custom component in a dedicated test environment, manage version controlling with git very fluently based on docker.
I also recommend @oncleben31 suggestions. This allows you to get a testing instance setup to write tests, but how to get your custom component easily run live with user interaction? Here is what I do from the structure already mentioned by @oncleben31, but I’m also interested if there is a better way.
Create a config folder in the base repo that is included in the .gitignore
Create a soft link inside config to the custom_components folder, i.e. ln -s custom_components config/custom_components
Run hass -c config
I would recommend you have homeassistant package installed (aka homeassistant/core, the naming is still really tough here) in a virtual environment, so you can keep your versions all neatly contained for this.