Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Popescu committed Nov 20, 2024
1 parent 80f1d5e commit 703d7ad
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 13 deletions.
31 changes: 22 additions & 9 deletions episodes/basic-git-commands.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ but not yet committed.

::::::::::::::::::::::::::::::::::::::::: callout

### Staging Area
#### Staging Area

If you think of Git as taking snapshots of changes over the life of a project,
`git add` specifies *what* will go in a snapshot
Expand Down Expand Up @@ -486,7 +486,7 @@ Date: Thu Aug 22 09:51:46 2013 -0400

::::::::::::::::::::::::::::::::::::::::: callout

## Word-based diffing
#### Word-based diffing

Sometimes, e.g. in the case of the text documents a line-wise
diff is too coarse. That is where the `--color-words` option of
Expand Down Expand Up @@ -813,6 +813,18 @@ $ git diff me.txt
::::::::::::::::::::::::::::::::::::::::::::::::::


::::::::::::::::::::::::::::::::::::: keypoints

- `git status` shows the status of a repository.
- Files can be stored in a project's working directory (which users see), the staging area (where the next commit is being built up) and the local repository (where commits are permanently recorded).
- `git add` puts files in the staging area.
- `git commit` saves the staged content as a new commit in the local repository.
- Write a commit message that accurately describes your changes.

::::::::::::::::::::::::::::::::::::::::::::::::



## Exploring History

As we saw in the previous episode, we can refer to commits by their
Expand Down Expand Up @@ -1367,6 +1379,14 @@ $ git log --patch HEAD~9 *.md

::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::: keypoints

- `git diff` displays differences between commits.
- `git restore` recovers old versions of files.

::::::::::::::::::::::::::::::::::::::::::::::::


## Ignoring Things

What if we have files that we do not want Git to track for us,
Expand Down Expand Up @@ -1638,13 +1658,6 @@ You can still include some specific exception with the exclamation point operato

::::::::::::::::::::::::::::::::::::: keypoints

- `git status` shows the status of a repository.
- Files can be stored in a project's working directory (which users see), the staging area (where the next commit is being built up) and the local repository (where commits are permanently recorded).
- `git add` puts files in the staging area.
- `git commit` saves the staged content as a new commit in the local repository.
- Write a commit message that accurately describes your changes.
- `git diff` displays differences between commits.
- `git restore` recovers old versions of files.
- The .gitignore file is a text file that tells Git which files to track and which to ignore in the repository.
- You can list specific files or folders to be ignored by Git, or you can include files that would normally be ignored.

Expand Down
18 changes: 17 additions & 1 deletion episodes/clean-code.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,23 @@ title: 'Clean Code'
---
## Introduction

Clean code is code that works correctly, it is easy to modify and maintain, as well as easy for other to understand.
Imagine you are reading a well-organized book or following a simple recipe.
Each step is clear, easy to understand, and there's no unnecessary clutter.
Now imagine the opposite—a messy, confusing set of instructions where you’re
constantly backtracking to figure out what’s going on.
**This is the difference between "clean code" and messy code in programming.**

Here are the key ideas behind *Clean Code*:
- Readable and Understandable
- Well-Organized
- Minimal but Effective
- Easy to Test
- Follows Good Practices

Why Clean Code Matters:
• For Teamwork: Most software projects involve multiple developers. Clean code ensures everyone can collaborate without getting stuck deciphering messy work.
• For Longevity: Code often lives longer than you think. Writing clean code saves you time in the future when making updates.
• For Quality: Clean code reduces bugs and improves the user experience of the software.


::: callout
Expand Down
3 changes: 3 additions & 0 deletions episodes/gitlab.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ title: 'GitLab'
- Adding users to a GitLab project
- Creating groups and adding users to groups

 
 
 

::::::::::::::::::::::::::::::::::::: keypoints

Expand Down
3 changes: 3 additions & 0 deletions episodes/python-virtual-environmants.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ We will fix this error in a moment.
- we provide two programs, one using Python 3.11 advanced features
- participants should test that more advanced program cannot run in the Python 3.11 environment, but does run in the 3.8 one.

 
 
 

:::::::::::::::::::::::::::::::::::::::: keypoints
- "Virtual environments keep Python versions and dependencies required by different projects separate."
Expand Down
3 changes: 0 additions & 3 deletions episodes/version_control.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,6 @@ Therefore, always check your current directory using the command `pwd`.

:::::::::::::::::::::::::::::::::::::::: keypoints

- Version control is like an unlimited ‘undo’.
- Version control also allows many people to work in parallel.
- Use git config with the --global option to configure a user name, email address, editor, and other preferences once per machine.
- `git init` initializes a repository.
- Git stores all of its repository data in the `.git` directory.

Expand Down

0 comments on commit 703d7ad

Please sign in to comment.