What is the recommended workflow if I want to pull a git repo into a virtual Python environment? I think it's easiest to:
git clone <repo>
, as this will work only in empty directories<repo>
.Or is there a better way?
Disclaimer: I'm quite a n00b with git, please bear with me. I'm well aware there are multiple similar answers already, however I couldn't find a convincing TL;DR. Perhaps I missed it.
We can use git module in python to clone the repository from git. Clone the repository you want to work with in local system. So in clone_from methods pass the two arguments in which first argument is url of your repository and second argument is the location of your directory where you want to cloned the repo.
In the Directory field, enter the path to the folder where your local Git repository will be created. Click Clone. If you want to create a project based on these sources, click Yes in the confirmation dialog. PyCharm will automatically set Git root mapping to the project root directory.
If there's already an existing virtualenv for a project that you want to clone a library into to work with, the following steps will help you:
source .venv/bin/activate.fish
pip uninstall <package>
pip install -e git+ssh://[email protected]/<org>/<package>.git#egg=<package>
cd .venv/src/<package>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With