Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect text in Understanding Workflow and History solution in episode 5 #1043

Closed
astroDimitrios opened this issue Nov 5, 2024 · 1 comment

Comments

@astroDimitrios
Copy link
Contributor

What is the problem?

In the challenge callout Understanding workflow and history the Solution says:

The answer is 2.
The changes to the file from the second echo command are only applied to the working copy, The command git add ketchup.md places the current version of ketchup.md into the staging area. not the version in the staging area.
So, when git commit -m "My opinions about the red sauce" is executed, the version of ketchup.md committed to the repository is the one from the staging area and has only one line.
At this time, the working copy still has the second line (and
git status will show that the file is modified). However, git restore ketchup.md replaces the working copy with the most recently committed version of ketchup.md. So, cat ketchup.md will output

It looks like the first and second lines have been muddled, perhaps it should say:

The answer is 2.

The changes to the file from the second `echo` command are only applied to the working copy,
not the version in the staging area.

So, when `git commit -m "My opinions about the red sauce"` is executed,
the version of `ketchup.md` committed to the repository is the one from the staging area and
only has one line, `I like tomatoes, therefore I like ketchup`.

At this time, the working copy still has the second line (and
`git status` will show that the file is modified).
However, `git restore ketchup.md`
removes all unstaged modifications to the `ketchup.md` file, so the second line is removed.
So, `cat ketchup.md` will output

Location of problem (optional)

https://swcarpentry.github.io/git-novice/05-history.html

@astroDimitrios astroDimitrios changed the title Understanding Workflow and History Incorrect Text Fix incorrect text in Understanding Workflow and History solution in episode 5 Nov 5, 2024
@martinosorb
Copy link
Contributor

This has been fixed by #1052. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants