-
Notifications
You must be signed in to change notification settings - Fork 0
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
Remove references to git checkout
#8
Conversation
Thank you!Thank you for your pull request 😃 🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}. If you have files that automatically render output (e.g. R Markdown), then you should check for the following:
Rendered Changes🔍 Inspect the changes: https://github.com/esciencecenter-digital-skills/git-lesson/compare/md-outputs..md-outputs-PR-8 The following changes were observed in the rendered markdown documents:
What does this mean?If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible. This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation. ⏱️ Updated at 2024-08-05 09:36:04 +0000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, | ||
we're telling Git that we want to recover the version of the file recorded in `HEAD`, | ||
which is the last saved commit. | ||
If we want to go back even further, | ||
we can use a commit identifier instead: | ||
|
||
```bash | ||
$ git checkout f22b25e mars.txt | ||
$ git restore -s f22b25e mars.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add a small comment that -s
refers to source
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point 👍
@svenvanderburg which |
@sjvrijn you are right. The only use of branching is in episode 3 I think which you already resolved. I think then in the later episodes on collaboration we should also make use of |
Auto-generated via {sandpaper} Source : 4085311 Branch : md-outputs Author : GitHub Actions <actions@github.com> Time : 2024-08-05 09:56:32 +0000 Message : markdown source builds Auto-generated via {sandpaper} Source : a1e60de Branch : main Author : Sander van Rijn <s.vanrijn@esciencecenter.nl> Time : 2024-08-05 09:55:46 +0000 Message : Merge pull request #8 from esciencecenter-digital-skills/5-replace-checkout-references Remove references to `git checkout`
Auto-generated via {sandpaper} Source : 4085311 Branch : md-outputs Author : GitHub Actions <actions@github.com> Time : 2024-08-05 09:56:32 +0000 Message : markdown source builds Auto-generated via {sandpaper} Source : a1e60de Branch : main Author : Sander van Rijn <s.vanrijn@esciencecenter.nl> Time : 2024-08-05 09:55:46 +0000 Message : Merge pull request #8 from esciencecenter-digital-skills/5-replace-checkout-references Remove references to `git checkout`
Auto-generated via {sandpaper} Source : 4085311 Branch : md-outputs Author : GitHub Actions <actions@github.com> Time : 2024-08-05 09:56:32 +0000 Message : markdown source builds Auto-generated via {sandpaper} Source : a1e60de Branch : main Author : Sander van Rijn <s.vanrijn@esciencecenter.nl> Time : 2024-08-05 09:55:46 +0000 Message : Merge pull request #8 from esciencecenter-digital-skills/5-replace-checkout-references Remove references to `git checkout`
Auto-generated via {sandpaper} Source : 4085311 Branch : md-outputs Author : GitHub Actions <actions@github.com> Time : 2024-08-05 09:56:32 +0000 Message : markdown source builds Auto-generated via {sandpaper} Source : a1e60de Branch : main Author : Sander van Rijn <s.vanrijn@esciencecenter.nl> Time : 2024-08-05 09:55:46 +0000 Message : Merge pull request #8 from esciencecenter-digital-skills/5-replace-checkout-references Remove references to `git checkout`
Auto-generated via {sandpaper} Source : 4085311 Branch : md-outputs Author : GitHub Actions <actions@github.com> Time : 2024-08-05 09:56:32 +0000 Message : markdown source builds Auto-generated via {sandpaper} Source : a1e60de Branch : main Author : Sander van Rijn <s.vanrijn@esciencecenter.nl> Time : 2024-08-05 09:55:46 +0000 Message : Merge pull request #8 from esciencecenter-digital-skills/5-replace-checkout-references Remove references to `git checkout`
Auto-generated via {sandpaper} Source : 4085311 Branch : md-outputs Author : GitHub Actions <actions@github.com> Time : 2024-08-05 09:56:32 +0000 Message : markdown source builds Auto-generated via {sandpaper} Source : a1e60de Branch : main Author : Sander van Rijn <s.vanrijn@esciencecenter.nl> Time : 2024-08-05 09:55:46 +0000 Message : Merge pull request #8 from esciencecenter-digital-skills/5-replace-checkout-references Remove references to `git checkout`
Auto-generated via {sandpaper} Source : 4085311 Branch : md-outputs Author : GitHub Actions <actions@github.com> Time : 2024-08-05 09:56:32 +0000 Message : markdown source builds Auto-generated via {sandpaper} Source : a1e60de Branch : main Author : Sander van Rijn <s.vanrijn@esciencecenter.nl> Time : 2024-08-05 09:55:46 +0000 Message : Merge pull request #8 from esciencecenter-digital-skills/5-replace-checkout-references Remove references to `git checkout`
Auto-generated via {sandpaper} Source : 4085311 Branch : md-outputs Author : GitHub Actions <actions@github.com> Time : 2024-08-05 09:56:32 +0000 Message : markdown source builds Auto-generated via {sandpaper} Source : a1e60de Branch : main Author : Sander van Rijn <s.vanrijn@esciencecenter.nl> Time : 2024-08-05 09:55:46 +0000 Message : Merge pull request #8 from esciencecenter-digital-skills/5-replace-checkout-references Remove references to `git checkout`
Fixes #5
This PR includes:
git checkout -b
withgit switch -c
git checkout HEAD <file>
withgit restore <file>
git status
with unstaged changes to mentiongit restore <file>
instead ofgit checkout -- <file>
git status
staged changes to mentiongit restore --staged <file>
instead ofgit reset HEAD <file>
git restore
git restore
instead ofgit checkout
git checkout
togit restore (-s)
, including explanation