> [!Tip]
> Create a projects directory to store all of your projects. I call mine `_dev` but you can call yours `projects` or anything you like. I will refer to this directory as your "projects directory" going forward and you'll see `_dev` in any command line commands.
## create a project directory
You can use your Windows Explorer to create your project directory of course, but it's more fun to use the command line.
- Open [[Git Bash]] (find Git Bash in your applications menu and start it).
- Enter the following commands in order to create a project directory, create a [[mamba]] environment, initialize [[git]], create a `.gitignore` and `README.md` file, and then open [[VS Code]].
```bash
cd _dev
mkdir <project>
mamba create -n <NAME>
mamba activate <NAME>
git init
touch .gitignore
touch README.md
code .
```
> [!Tip]
> I recommend calling the environment the same as the project name (i.e., project root directory). That way you can set up an [[alias `workon`]] to quickly jump back into a project.
## open files with their default application
To open the README.md file in your preferred markdown editor (I use [[Typora]]), use
```bash
start README.md
```
You may need to select the application you want to use to open markdown files if you have not already configured it.
## edit files directly in Bash
To edit a file directly in [[Bash]], open [[nano]] (or [[vim]] if you prefer).
```
nano .env
```
Make changes and then save with `Ctrl+O` and `Ctrl+X` to exit.
Use `cat` to print the file contents to screen to confirm the changes were saved correctly.
```bash
cat .env
```
## build the directory
Populate the empty directory with standard folder structure (as you go).
```
|--data
| |--raw
| |--processed
| |--external
| |--interim
|--docs
|--notebooks
|--scripts
|--secrets
```
## install packages
- Install packages to the environment when needed
```bash
mamba install <PACKAGE NAME>
```
> [!Tip]
> See the conda package manager for help with package channels. Note that `pip` and `conda` package managers shouldn't be mixed. Install everything you can with conda, and if a package isn't available on conda, switch to pip and don't use conda again for that project.
If you're using [[Jupyter Notebook]], you'll want to install [[iPython kernel]].
- Create `environment.yml` and `requirements.txt` files
```
mamba export --from-history > environment.yml
pip freeze > requirements.txt
```
*Note that most of the time you'll want a pip compatible requirements file (e.g., deploying to Heroku). However, if you're collaborating with others using conda, you can create a .yml file instead. I recommend creating both.*
- Commit with git
```bash
git commit -am "<message>"
```
- [[Create a repository on GitHub]]
- Push to GitHub
[[Snakemake]]