Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed Apr 22, 2024
1 parent ec1b1ae commit 1ccfc4e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
2 changes: 2 additions & 0 deletions lessons/git-en/basics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Create a new directory now and navigate inside (use the command `cd`).
Then, create a new Git <em>repository</em> using the command `git init`:

```ansi
␛[36m$␛[0m mkdir lessongit
␛[36m$␛[0m cd lessongit
␛[36m$␛[0m git init
Initialized empty Git repository in ./.git/
```
Expand Down
21 changes: 16 additions & 5 deletions lessons/git-en/branching/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,29 @@ On a single "branch" you can work, but you can switch to another (even older) br
do some changes and then change back to new branch and continue,
or *merge* the changes.

{{ figure(
img=static('git_branch.png'),
alt="Diagram showing the usual branching way of work"
) }}

Branching comes handy also when more people are working on a same project -
everyone is working on his/her own branch and when the time comes,
all changes are combined (merged) together.


> [note]
> Instead of copying files from directory to directory.
> Git stores a branch as a reference to a commit.
> In this sense, a branch represents the tip of a series of commits—it's not a container for commits.
You can check what branches you have in your repository.
For that, we have a command `git branch`:

```ansi
␛[36m$␛[0m git branch
* ␛[32mmain␛[m
```

We should have only one and it is called `main`.

– it is a traditionally name of "backbone" branch for the project
Expand Down Expand Up @@ -61,11 +73,10 @@ Switched to branch 'adding-author'
main␛[m
```

So, now you are "in" branch `adding-author`
Add some author name into your file `poem.txt`.
And with the help of `git add` and `git commit` perform new commit.
Perfect!
You can check how it looks using `git show`, `git status` or `git log`.
So, now you are "on" branch `adding-author`. It also means that your **HEAD** is there - **HEAD** refers to the currently checked-out branch's latest commit.

Now add some author name into your file `poem.txt`. And with the help of `git add` and `git commit` perform new commit.
Perfect! You can check how it looks using `git show`, `git status` or `git log`.

Let's leave the adding the author of the poem for a moment.
Go back to branch `main` and create a branch called
Expand Down
Binary file removed lessons/git-en/branching/static/branch1.png
Binary file not shown.
Binary file removed lessons/git-en/branching/static/branches.png
Binary file not shown.
Binary file added lessons/git-en/branching/static/git_branch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lessons/git-en/branching/static/merge.png
Binary file not shown.
4 changes: 2 additions & 2 deletions runs/2024/pyladies-en-vienna-2024-spring/info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ plan:
- title: Have you just made a git mess?
url: https://raw.githubusercontent.com/lubojr/naucse.python.cz/6307e5867765be0dd1a1e551901e4b4aca150d6c/lessons/git-en/basics/static/git-pretty.png
type: cheatsheet
# - lesson: beginners-en/tictactoe
# type: homework
- lesson: beginners-en/tictactoe
type: homework

- title: Lists, Tuples
slug: list
Expand Down

0 comments on commit 1ccfc4e

Please sign in to comment.