{"id":18869372,"url":"https://github.com/codersales/conda-deactivate-in-git-bash","last_synced_at":"2025-08-17T12:42:11.242Z","repository":{"id":190849615,"uuid":"683329023","full_name":"CoderSales/conda-deactivate-in-git-bash","owner":"CoderSales","description":"documentation on how to automate conda deactivation in git bash","archived":false,"fork":false,"pushed_at":"2023-08-27T00:36:31.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T23:33:04.800Z","etag":null,"topics":["anaconda","conda","documentation","git-bash","python"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CoderSales.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-26T08:02:18.000Z","updated_at":"2023-08-28T10:00:43.000Z","dependencies_parsed_at":"2023-08-26T18:39:13.172Z","dependency_job_id":null,"html_url":"https://github.com/CoderSales/conda-deactivate-in-git-bash","commit_stats":null,"previous_names":["codersales/conda-deactivate-in-git-bash"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderSales%2Fconda-deactivate-in-git-bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderSales%2Fconda-deactivate-in-git-bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderSales%2Fconda-deactivate-in-git-bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderSales%2Fconda-deactivate-in-git-bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoderSales","download_url":"https://codeload.github.com/CoderSales/conda-deactivate-in-git-bash/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239816510,"owners_count":19701753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anaconda","conda","documentation","git-bash","python"],"created_at":"2024-11-08T05:16:34.967Z","updated_at":"2025-02-20T10:16:11.180Z","avatar_url":"https://github.com/CoderSales.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# conda-deactivate-in-git-bash\n\n## Setup\n\n`conda` and `git bash`\n\n## Use Automation instead of typing the command\n\nInstead of running the following command in git bash :\n\n``` bash\nconda deactivate\n```\n\nUse :\n\n## Automation\n\nIn `.bashrc` file :\n\n``` .bashrc\nalias deactivate_conda=\"./deactivate_conda.sh\"\nalias deactivate_conda_base=\"conda deactivate\"\n```\n\nIn `deactivate_conda.sh` :\n\n``` deactivate_conda.sh\n#!/bin/bash\n# conda deactivate\n```\n\nconda deactivate commented out in script above for the following reason:\n\nChatGPT3.5 Recommendation/Fix:\n\n``` text\nIn your deactivate_conda.sh script, you have the following line:\n```\n\n```bash\n\nconda deactivate\n\nThis line is interpreted as a command to the conda tool,\nand it's trying to find a command named\n\"deactivate\"\nwithin conda,\nwhich doesn't exist.\n\nThis is causing the error message you're seeing.\n\nTo fix this issue,\nyou should remove the line\nconda deactivate\nfrom the deactivate_conda.sh script.\n\nSince you're using the\nalias deactivate_conda_base\nto deactivate the base Conda environment,\nyou don't need to manually run\n\nconda deactivate\n\nin your script.\n```\n\nIn `git bash` cli :\n\n`Mod`ify the `deactivate_conda.sh` shell script to make a `.exe` executable file in the background:\n\n``` bash\n$ chmod +x deactivate_conda.sh\n```\n\ncall the `deactivate_conda.sh` file in the current (`.`) directory :\n\nChatGPT3.5 recommendation: \n\n``` text\nJust a quick note,\nwhen you use the chmod +x command on a script,\nyou're making it executable,\nwhich means you can run it directly without specifying the interpreter\n(e.g., ./script.sh).\n\nSo, in your process, you could directly run\ndeactivate_conda.sh\nwithout needing to add the\n./\nbefore it.\n```\n\n\n``` bash\n$ ./deactivate_conda.sh\n```\n\n`source` the `.bashrc` file :\n\n``` bash\n$ source ~/.bashrc\n```\n\nrun the `deactivate_conda_base` alias made above in the `.bashrc` file which runs the command `conda deactivate` automatically :\n\n``` bash\ndeactivate_conda_base\n```\n\n## Revised / Summary process iteration 1:\n\n1 :\n\n``` bash\nchmod +x deactivate_conda.sh\n```\n\n2 :\n\n``` bash\ndeactivate_conda.sh\n```\n\n3 :\n\n``` bash\nsource ~/.bashrc\n```\n\n4 :\n\n``` bash\ndeactivate_conda_base\n```\n\n## Revised / Summary process iteration 2:\n\n1 :\n\n``` bash\nsource ~/.bashrc\n```\n\n2 :\n\n``` bash\ndeactivate_conda_base\n```\n\n## References\n\n[ChatGPT3.5](https://chat.openai.com/)\n[Anaconda and Git Bash in Windows: Solving the 'conda: command not found' Issue](https://saturncloud.io/blog/anaconda-and-git-bash-in-windows-solving-the-conda-command-not-found-issue/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodersales%2Fconda-deactivate-in-git-bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodersales%2Fconda-deactivate-in-git-bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodersales%2Fconda-deactivate-in-git-bash/lists"}