mirror of
https://codeberg.org/Mo8it/How_To_Linux.git
synced 2024-11-23 22:31:35 +00:00
Done day 3
This commit is contained in:
parent
f82bffd78f
commit
3372213507
5 changed files with 192 additions and 20 deletions
|
@ -14,12 +14,12 @@
|
||||||
- [Regex](day_2/regex.md)
|
- [Regex](day_2/regex.md)
|
||||||
- [CLIs of the day](day_2/clis_of_the_day.md)
|
- [CLIs of the day](day_2/clis_of_the_day.md)
|
||||||
- [Tasks](day_2/tasks.md)
|
- [Tasks](day_2/tasks.md)
|
||||||
|
|
||||||
<!--
|
|
||||||
- [Day 3](day_3/README.md)
|
- [Day 3](day_3/README.md)
|
||||||
- [Notes](day_3/notes.md)
|
- [Notes](day_3/notes.md)
|
||||||
- [CLIs of the day](day_3/clis_of_the_day.md)
|
- [CLIs of the day](day_3/clis_of_the_day.md)
|
||||||
- [Tasks](day_3/tasks.md)
|
- [Tasks](day_3/tasks.md)
|
||||||
|
|
||||||
|
<!--
|
||||||
- [Day 4](day_4/README.md)
|
- [Day 4](day_4/README.md)
|
||||||
- [Shell scripting](day_4/shell_scripting.md)
|
- [Shell scripting](day_4/shell_scripting.md)
|
||||||
- [Notes](day_4/notes.md)
|
- [Notes](day_4/notes.md)
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
# Day 3
|
# Day 3
|
||||||
|
|
||||||
Coming soon...
|
This day is all about Git and it will be very interactive.
|
||||||
|
|
||||||
|
I will present the content live while drawing on the board, running commands, using graphical user interfaces and git platforms.
|
||||||
|
|
||||||
|
If you are reading this from home, then I am sorry for not having explanations here.
|
||||||
|
I think that Git can be explained better live.
|
||||||
|
But don't worry, if you do the tasks then you will have a solid knowledge about Git.
|
||||||
|
Especially if you finish big parts of the game [Oh My Git!](https://ohmygit.org/)
|
||||||
|
|
|
@ -1,3 +1,27 @@
|
||||||
# CLIs of the day
|
# CLIs of the day
|
||||||
|
|
||||||
## typos
|
## [typos](https://github.com/crate-ci/typos)
|
||||||
|
|
||||||
|
A command line tool that checks your (code) files for typos.
|
||||||
|
|
||||||
|
You can just run it in the directory that you want to check and it will show you all the typos it finds.
|
||||||
|
|
||||||
|
You can then run `typos -w` to let it fix typos automatically.
|
||||||
|
But you have to fix some typos yourself if `typos` has more than one possible fix.
|
||||||
|
|
||||||
|
## [gitui](https://github.com/extrawurst/gitui)
|
||||||
|
|
||||||
|
A terminal user interface (TUI) for Git written in Rust 🦀
|
||||||
|
It is very user friendly and self explanatory like Zellij.
|
||||||
|
|
||||||
|
## [lazygit](https://github.com/jesseduffield/lazygit)
|
||||||
|
|
||||||
|
Another TUI for Git (but written in Go 👎️).
|
||||||
|
Try both to find out which one you like more.
|
||||||
|
|
||||||
|
## [git-cliff](https://git-cliff.org/)
|
||||||
|
|
||||||
|
Automatically generates a `CHANGELOG.md` file based on [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).
|
||||||
|
|
||||||
|
Conventional commits have their pros and cons.
|
||||||
|
Try them out to see if you like their systematic approach.
|
||||||
|
|
|
@ -1 +1,47 @@
|
||||||
# Notes
|
# Notes
|
||||||
|
|
||||||
|
The participants of the course will add a description to each of these Git subcommands.
|
||||||
|
|
||||||
|
## git config
|
||||||
|
|
||||||
|
## git init
|
||||||
|
|
||||||
|
## git clone
|
||||||
|
|
||||||
|
## git status
|
||||||
|
|
||||||
|
## git add
|
||||||
|
|
||||||
|
## git commit
|
||||||
|
|
||||||
|
## git log
|
||||||
|
|
||||||
|
## git diff
|
||||||
|
|
||||||
|
## git branch
|
||||||
|
|
||||||
|
## git checkout
|
||||||
|
|
||||||
|
## git push
|
||||||
|
|
||||||
|
## git pull
|
||||||
|
|
||||||
|
## git rebase
|
||||||
|
|
||||||
|
## git merge
|
||||||
|
|
||||||
|
## git reset
|
||||||
|
|
||||||
|
## git revert
|
||||||
|
|
||||||
|
## git cherry-pick
|
||||||
|
|
||||||
|
## git remote
|
||||||
|
|
||||||
|
## git blame
|
||||||
|
|
||||||
|
## git stash
|
||||||
|
|
||||||
|
## git tag
|
||||||
|
|
||||||
|
## git lfs
|
||||||
|
|
|
@ -1,23 +1,118 @@
|
||||||
# Tasks
|
# Tasks
|
||||||
|
|
||||||
Do the tasks in the given order! They depend on each other.
|
## Task: Installation
|
||||||
|
|
||||||
## Task: SSH key
|
Install Git and [VS-Code](https://code.visualstudio.com/) on your own machine (not in the provided browser terminal).
|
||||||
|
|
||||||
## Task: GitUI
|
Open a Git terminal and run the following commands to tell Git about your name (`USERNAME`) and email (`EMAIL`)
|
||||||
|
|
||||||
## Task: Lazygit
|
```bash
|
||||||
|
$ git config --global user.name "USERNAME"
|
||||||
|
|
||||||
In this task, you will learn using Lazygit.
|
$ git config --global user.email "EMAIL"
|
||||||
|
```
|
||||||
|
|
||||||
1. Install Lazygit. Follow the instructions for Fedora on [github.com/jesseduffield/lazygit](https://github.com/jesseduffield/lazygit). You might need to install `dnf-plugins-core` first to be able to add something via _COPR_ (Cool Other Package Repo).
|
You don't have to use VS-Code for the tasks, but you should at least try it out with its Git integration.
|
||||||
1. Put the files and directories that you did create during the course into a directory.
|
|
||||||
1. Go into the directory.
|
## Task: Register on Codeberg 🏔️
|
||||||
1. Run `lazygit`. It will initialize a git repository in this directory if none already exists. Confirm the initialization. Starting with now, every git operation should be done in Lazygit.
|
|
||||||
1. Add everything as staged.
|
Register an account on [Codeberg](https://codeberg.org/).
|
||||||
1. Commit.
|
It is a Git platform similar to Github and Gitlab, but it is fully free and open source and based in Europe.
|
||||||
1. Create a repository on [git.mo8it.com](https://git.mo8it.com).
|
|
||||||
1. Add the new remote.
|
## Task: Stars ⭐️
|
||||||
1. Push to the new remote.
|
|
||||||
1. Modify a file (or multiple files).
|
_Just to learn_ how to star repositories, you could add some stars to [my personal ones](https://codeberg.org/mo8it) 😜
|
||||||
1. Verify your changes in Lazygit, stage, commit and push.
|
|
||||||
|
We do everything here for educational purposes 😇
|
||||||
|
|
||||||
|
## Task: Issues
|
||||||
|
|
||||||
|
Create an issue on [the repository of the course](https://codeberg.org/mo8it/dev-tools) that gives me some quick feedback about the course so far.
|
||||||
|
|
||||||
|
Read some of the issues created by others and add some emoji reactions and maybe a reply to them.
|
||||||
|
|
||||||
|
## Task: SSH key pair
|
||||||
|
|
||||||
|
Create an SSH key pair _without a passphrase_ and add its public part to your Codeberg account following the beginning of [this guide](https://docs.codeberg.org/security/ssh-key/).
|
||||||
|
|
||||||
|
I am recommending to not use a passphrase for now to be able to focus on Git itself.
|
||||||
|
But for a better security in general, you should use a passphrase for your SSH keys outside this course.
|
||||||
|
|
||||||
|
## Task: Markdown
|
||||||
|
|
||||||
|
You can take a look at [this guide](https://docs.codeberg.org/getting-started/first-repository/) for this task.
|
||||||
|
|
||||||
|
Create a new repositry called `dev-tools-demo` and clone it to your machine with `git clone SSH_GIT_LINK`.
|
||||||
|
|
||||||
|
After cloning, a new directory should be created with the name of the repository.
|
||||||
|
Move into that directory and create the markdown file `README.md`.
|
||||||
|
|
||||||
|
Follow [this guide about Markdown](https://www.markdownguide.org/basic-syntax/) to write some words about the course so far in the README file.
|
||||||
|
Use all of the Markdown following building blocks:
|
||||||
|
|
||||||
|
- Headings with different levels
|
||||||
|
- Paragraphs with some **bold** and _italic_ text
|
||||||
|
- A list
|
||||||
|
- A table
|
||||||
|
- A blockquote
|
||||||
|
- Some `bash` code examples inside of code blocks
|
||||||
|
- A link to some website
|
||||||
|
- An image
|
||||||
|
|
||||||
|
Create a commit after each building block:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ git add README.md
|
||||||
|
|
||||||
|
$ git commit -m "MEANINGFUL MESSAGE"
|
||||||
|
```
|
||||||
|
|
||||||
|
`push` your changes after being done with all building blocks.
|
||||||
|
|
||||||
|
Verfiy that the README file was rendered as expected.
|
||||||
|
If not, fix the Markdown issues, commit and push the changes again.
|
||||||
|
|
||||||
|
## Task: License
|
||||||
|
|
||||||
|
Add the [AGPLv3 license](https://choosealicense.com/licenses/agpl-3.0/) as a file `LICENSE.txt` to your demo repository.
|
||||||
|
Commit and push the file!
|
||||||
|
|
||||||
|
You can read more about licenses later.
|
||||||
|
Discussing different ones is out of the scope of this course.
|
||||||
|
|
||||||
|
But it is important to add a license to your projects!
|
||||||
|
AGPLv3 is the one that I normally use and recommend for free open source software.
|
||||||
|
You can read about it and compare it to others using [choosealicense.com](https://choosealicense.com) for example.
|
||||||
|
|
||||||
|
## Task: Write the script for me
|
||||||
|
|
||||||
|
Fork [the repository of the course](https://codeberg.org/mo8it/dev-tools) and clone your fork into your machine.
|
||||||
|
|
||||||
|
You will find the most important Git subcommands in the file `src/day_3/notes.md`, but these are still missing a description.
|
||||||
|
|
||||||
|
Pick one of the subcommand that don't have a description yet.
|
||||||
|
Create a branch that has the same name as the chosen Git subcommand.
|
||||||
|
|
||||||
|
Add a description to the chosen subcommand in your own words.
|
||||||
|
Add some examples for how to use that subcommand.
|
||||||
|
|
||||||
|
Commit your changes and push the branch to your fork.
|
||||||
|
Create a pull request using that branch.
|
||||||
|
|
||||||
|
## Task: Collaboration
|
||||||
|
|
||||||
|
> Note: You have to skip this task if you are working from home.
|
||||||
|
|
||||||
|
Team up with another participant that is also done with his demo repository and do the following together:
|
||||||
|
|
||||||
|
- Give the other participant a star ⭐️
|
||||||
|
- On the repository of the other participant, create an issue giving some **nice** feedback about the content of the README file.
|
||||||
|
- Reply to the issue created by the other participant on your own repository and close it if no actions are required.
|
||||||
|
- Fork the other repository, clone the fork, create a new branch and add a few lines to the README file that fit the original content.
|
||||||
|
- Push that branch to your fork.
|
||||||
|
- Create a pull request on the original repository using the pushed branch.
|
||||||
|
- Merge the pull request that you receive on your own repository.
|
||||||
|
|
||||||
|
## Task: Oh My Git!
|
||||||
|
|
||||||
|
Download and play the awesome educational game [Oh My Git!](https://ohmygit.org/) 🎮️
|
||||||
|
|
Loading…
Reference in a new issue