---
# System prepended metadata

title: 'Git, Bash and Workspace Setup'
tags: [Templates, Book]

---

# Git, Bash and Workspace Setup

The following resources have been broken down into:
1. Exhaustive (i.e., Mandatory)
2. Non-Exhaustive (i.e., Helpful for better understanding but not mandatory)
3. Optional References (for extra exploration)

Assignment tasks are explicitly mentioned—make sure to submit them in the required format. The submission deadline for this lecture-assignment is **14th February, 11:59 PM**. Total 5 tasks assigned.

Additionally, there are some workspace setup prerequisites to ensure that you can work smoothly with the tools we’ll cover. Go through them and make sure your system is set up accordingly.


## Workspace Setup (REQUISITE)

Before diving in, ensure you have the right CLI (Command Line Interface) for the tasks ahead.

### WSL - Windows Subsystem for Linux

(Skip this if you’re on macOS or already using Linux)

**What is WSL?**

WSL lets you run a Linux environment directly on Windows without needing a separate virtual machine or dual-boot setup. This means you get access to Linux tools, applications, and CLI utilities while staying on your Windows machine.

**Installation**

1. Turn it on!
* Search Turn Windows features on or off
* Enable Windows Subsystem for Linux
* Restart your PC
2. Install it!
* Open your terminal and run `wsl --install`, this will install WSL with default Ubuntu Distribution
* Want a different distribution? Run: `wsl --install <Distribution_Name>`, use `wsl --list --online` to list all distributions available (you can have any number of distributions installed simultaneously)
* Run `sl` in your Linux Terminal


References: [WSL Setup Guide](https://learn.microsoft.com/en-us/windows/wsl/install)


### For macOS Users

Try and have Homebrew installed - it’s a handy package manager.

References: [M1 Mac](https://stackoverflow.com/questions/66666134/how-to-install-homebrew-on-m1-mac), [Intel Mac](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-homebrew-on-macos)

## Shell

You should know your way around your system through your terminal, who knows when you will be stuck in a Vim session not knowing how to exit, lost there for eternity. Follow the following resources to learn about the Shell and the basic commands you should know:

> Exhaustive Resources
1. [Missing Semester - The Shell](https://missing.csail.mit.edu/2020/course-shell/)
2. [Missing Semester - Shell Tools and Scripting](https://missing.csail.mit.edu/2020/shell-tools/)

> Non Exhaustive Resources
1. [Corey Schafer - Terminal Tutorial](https://www.youtube.com/watch?v=j6vKLJxAKfw&list=PL-osiE80TeTvGhHkpvfmKWOiIPF8UVy6c)
2. [AWS - What is CLI?](https://aws.amazon.com/what-is/cli/)

> ASSIGNMENT
1. Complete 15 levels of [Bandit - Wargame](https://overthewire.org/wargames/bandit/)
P.S. for this assignment you might need knowledge of SSH, refer to 
    1. [SSH Workflow](https://medium.com/@hellomudit/understanding-ssh-workflow-66a0e8d4bf65) 
    2. [Understanding the SSH Encryption and Connection Process](https://www.digitalocean.com/community/tutorials/understanding-the-ssh-encryption-and-connection-process)
2. All exercises mentioned in the Missing Semester Resources


## Git

As explained and hopefully understood, Git is an essential tool-no excuses!. Here’s how to get started:

### Installation

Check if you already have git installed on whatever system you are using `git --version`, if you don't have it installed, you can install it by running `sudo apt-get install git` on WSL/Linux.

If you have some other OS and you don't have git installed, look over the web about how to install git on the package manager you have in your OS, you would most probably find a good comprehensive installation guide.


> Exhaustive Resources
1. [Missing Semester - Version Control](https://missing.csail.mit.edu/2020/version-control/)
2. [Corey Schafer - Git Tutorial for Beginners](https://www.youtube.com/watch?v=HVsySz-h9r4)
    
> Non Exhaustive Resources
1. [Fireship - How to use Git and GitHub?](https://www.youtube.com/watch?v=HkdAHXoRtos)
2. [Git Branching](https://learngitbranching.js.org/)

> Optional Resources
1. [Popular Git Commands](https://dzone.com/articles/top-20-git-commands-with-examples) - Referenced to in the lecture session conducted
2. [How to explain git in simple words?](https://xosh.org/explain-git-in-simple-words/)

The exhaustive and non exhaustive resources for this part are mostly alternates to each other, it is not at all expected from anyone to watch all of them, pick one (or more) that suit you the most. Just make sure you have a clear understanding of what is going on and what are the steps involved.

> ASSIGNMENT
1. [Git Immersion](https://gitimmersion.com/)
2. All exercises mentioned in the Missing Semester Resource


📝 Try documenting out all the git commands (and all other terminal commands) that you learn at a proper place, which you can refer in case you get stuck some time in the future.


## Open Source and GitHub

These are optional, but super useful if you want to contribute to open-source projects in the future. It is recommended that you do have a look at these, but there is no need to to peruse them right now if you are short on time. 

1. [Complete Guide to Open Source](https://www.youtube.com/watch?v=yzeVMecydCE) -  A good walkthrough over GitHub's Interface and the basic How To's of Open Source and quite importantly, also includes a guide on how to write Markdown.
2. [How to Write a Git Commit Message](https://cbea.ms/git-commit/) - Though not all the points mentioned are applicable as "best practice" everywhere but still they are quite standardly followed and appreciated wherever attention is paid to them. Might not be very useful to you as of now, but certainly somewhere down the line, it will come in handy. Atleast know they exist basically.


## Virtual Environments - Anaconda

In essence, a virtual environment is an isolated environment within your computer where you can install packages and libraries without affecting the rest of your system.

Imagine that you are working on two projects, each requiring different versions of the same library. If you install both versions on your system, you might run into version conflicts that can cause bugs or even crashes. With virtual environments, you can create a separate environment for each project, and install the required libraries without any conflicts.

One popular tool for managing virtual environments in data science is Anaconda. Anaconda is a Python distribution that comes with a package manager called Conda, which allows you to create and manage virtual environments, as well as install packages and dependencies with ease. For data science and ML projects, Conda (via Anaconda) is widely used for managing environments.

You would need to have Anaconda Virtual Environments Setup and a basic understanding of why they are really needed, make use of the following resources for the same:

> SETUP IS A REQUISITE
1. [Anaconda Installation Guide](https://docs.anaconda.com/anaconda/install/index.html)
2. [TechWithTim - Anaconda Tutorial](https://www.youtube.com/watch?v=mIB7IZFCE_k)

> Helpful References
1. [Academind - Conda: What & Why?](https://www.youtube.com/watch?v=23aQdrS58e0)
2. [Anaconda Commands Cheat-Sheet](https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf)


## Put your entire knowledge to use!
> THE FINAL BOSS (ASSIGNMENT)

Write a small Bash script to automate a task on your system. Explain the problem your script solved and provide the script output after execution. Your submission should include your bash script file (.sh), a short justification and screenshot or terminal output of the script's result (both in a single markdown file).


## Bonus - If You Want to Go Deeper:
In case all of this did not bleed you dry, and you want to go deeper into these topics, look into these resources:
1. [The Git Book](https://git-scm.com/book/en/v2) - G.O.A.T.
2. [awesome-bash](https://github.com/awesome-lists/awesome-bash) -  A repository full of links diving deep into Bash.


## TIPS

* **Setting up your workspace properly is crucial**. If your environment isn’t configured correctly, you’ll run into frustrating errors later. 
* **Don’t use Gen-AI tools to solve assignments**. It’s fine to use them to understand concepts, but relying on them for answers defeats the purpose. You’ll learn a lot more by figuring things out yourself.
* **Google is your best friend**. When you’re stuck, search engines, Stack Overflow, and other forums are lifesavers. Knowing how to look for solutions is just as important as knowing the solutions themselves.
