Skip to content

Commit

Permalink
Merge pull request #1 from CSU-CPT/fabio-git
Browse files Browse the repository at this point in the history
Fabio git
  • Loading branch information
fabiohj7 authored Sep 29, 2024
2 parents fd7af59 + af98643 commit 54e3bab
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 20 deletions.
Binary file added src/.DS_Store
Binary file not shown.
14 changes: 8 additions & 6 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
[Introduction](./introduction.md)

- [What is Linux?](./ch1-linux.md)
- [How to Install Linux](./ch1.1-linux-installation.md)
- [Using the Linux Terminal](./ch1.2-linux-terminal.md)
- [What is Git?](./ch2-git.md)
- [How to Install git](./ch2.1-git-installation.md)
- [Using git](./ch2.2-using-git.md)
- [How to Install Linux](./ch1.1-linux-installation.md)
- [Using the Linux Terminal](./ch1.2-linux-terminal.md)
- [What is Git? Why Git?](./ch2-git.md)
- [How to Install git](./ch2.1-git-installation.md)
- [Using git](./ch2.2-using-git.md)

---

[Cheat Sheet](./cheat-sheet.md)
[Cheat Sheet](./cheat-sheet.md)

15 changes: 13 additions & 2 deletions src/ch2-git.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# What is Git?
# What is Git? Why Git?

### Version control

Git is a version control system (VCS) that allows developers to track changes to their code over time.

It basically takes a picture of what your files look like at the moment and stores a reference to a snapshot.

### Code colaboration

Lets say that you need to work on a coding project with your lab partner. How can both of you work on the same codebase?

Git makes this possible

Git is a version control system (VCS) that allows developers to track changes to their code over time.
20 changes: 20 additions & 0 deletions src/ch2.1-git-installation.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# How to Install git

## Linux

Install it using your favourite package manager.

`$ sudo apt-get install git-all`

## MacOS

MacOS will already have git installed by default.

## Windows

1. Go to the latest [Git Windows installer](https://gitforwindows.org/) and download the latest version.

2. Follow the instructions as provided by the installer wizard.

3. Open the windows command prompt.

4. Type `git version` to verify Git was installed.
50 changes: 50 additions & 0 deletions src/ch2.2-using-git.md
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
# Using git

## How does it work?

You will first create what is called a repository, this is the place where your code will be.

In our case main will be our master repository. This is the main code that will be used.

### Branches

From this main code you can create branches, this allows you to make changes without the chance of ruining the main code. Think of it as a copy of your code that you can now change with zero risks.

Use this command to create a new branch:

`git checkout -b "name_of_the_branch"`

To switch branches

`git checkout "name_of_the_branch"`

![Drawing-0](./images/IMG_36D4CB635079-1.jpeg)

### Staging

Once we made some changes we will want to commit them, before we can do that we want to stage the files. This is like another layer to saving your files. This is so if you have two files you changed but only one is ready to commit, you can select the file to stage.

To stage your file run this command:

`git add file_name/folder_name`

TIP:

use this command to see the changes made.

`git status`

### Committing

Creating a commit creates a snapshot of all the staged files

TIP: For commit messages do you not use past tense, such as "I made headings blue". Use language like "Make headings blue", as if you are giving orders to the codebase.

This command creates a commit:

`git commit -m "description of the commit"`

![Drawing-1](./images/IMG_23DAA7999A27-1.jpeg)

A good way of visualizing how this works

![Drawing-2](./images/IMG_96E3138F72ED-1.jpeg)
Binary file added src/images/IMG_23DAA7999A27-1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/IMG_36D4CB635079-1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/IMG_96E3138F72ED-1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 15 additions & 12 deletions src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ This book is written for less experienced Computer Science students who are inte
Because of their adoption, essentially ever developer (unless they are working on a legacy code base) will use these technologies on a daily basis. For this reason, and because knowledge of Linux is required for upper level classes at the Washkewicz College of Engineering at CSU (like C Programming and Operating Systems), we, the [Computer Peer Teachers (CPTs)](https://engineering.csuohio.edu/advising/computer-peer-teachers-cpts), have decided to offer a short introductory workshop on both of these topics. This is the accompanying book for that workshop.

During this workshop, we seek to answer the following questions for Linux:
* [What is Linux?](./ch1-linux.md)
* [What is a Linux distribution ("distro")?](./ch1-linux.md#what-is-a-linux-distribution)
* [What is a Desktop Environment?](./ch1-linux.md#what-is-a-desktop-environment)
* [Why should I care about Linux?](./ch1-linux.md#why-should-i-care-about-linux)
* How do you install popular Linux distros like Ubuntu, Debian, Mint, Fedora, and others?
* How to use the terminal

- [What is Linux?](./ch1-linux.md)
- [What is a Linux distribution ("distro")?](./ch1-linux.md#what-is-a-linux-distribution)
- [What is a Desktop Environment?](./ch1-linux.md#what-is-a-desktop-environment)
- [Why should I care about Linux?](./ch1-linux.md#why-should-i-care-about-linux)
- How do you install popular Linux distros like Ubuntu, Debian, Mint, Fedora, and others?
- How to use the terminal

And for git:
* [What is git?](./ch2-git.md)
* Why is it important? What are the use cases?
* How do you install git (on Windows, MasOS, and Linux)?
* How do you use git from the terminal?
* Git in VSCode

A link for the recorded portion of the workshop will be provided soon.
- [What is git? Why Git?](./ch2-git.md)
- Why is it important? What are the use cases?
- How do you install git (on Windows, MasOS, and Linux)?
- How do you use git from the terminal?
- Git in VSCode

A link for the recorded portion of the workshop will be provided soon.

0 comments on commit 54e3bab

Please sign in to comment.