If you follow the recommended instructions when installing [[miniforge3]], and did not check the option to add miniforge3 to your [[PATH]] variable, follow these instructions to use [[conda]] and [[mamba]] with [[Git Bash]]. Before you begin, make sure you [[configure git]]. ## Instructions - Navigate to the miniforge3 directory using your File Explorer. - Navigate to the subdirectory `miniforge3/etc/profile.d` . - Right-click and select 'Git Bash Here' from the context menu. - In the prompt, type: ```bash echo ". '${PWD}'/conda.sh" >> ~/.bashrc echo ". '${PWD}'/mamba.sh" >> ~/.bashrc ``` - Close or restart Git Bash for the changes to take effect. >[!INFO] >With this command, you are writing (`echo`) the file path to the `conda.sh` file by replacing `PWD` with the path to the current working directory to a file called `.bashrc` that is stored in your home directory (denoted by the `~`). Now, when you open Git Bash you can use `conda` or `mamba` commands like `mamba activate <env>` to activate any `conda` environment. Windows users will need to [[enable conda and mamba on Bash]] by running the command `conda init bash`, this only needs to be done once. To begin an interactive Python session, first activate the `base` environment and then type `python`. (Note that you might instead need to use `winpty` to launch an interactive Python session if you selected MinTTY to be the default terminal when installing Git). For more, see Code Academy's [detailed guide](https://discuss.codecademy.com/t/setting-up-conda-in-git-bash/534473). > [!Warning] > Be careful when copying and pasting code from the internet into your command prompt. It's possible to do very bad things very quickly. I have yet to see an instance of someone posting malicious code masquerading as help, but just know it's possible.