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

Remove references to git checkout #8

Merged
merged 8 commits into from
Aug 5, 2024
Merged

Conversation

sjvrijn
Copy link
Contributor

@sjvrijn sjvrijn commented Jun 26, 2024

Fixes #5

This PR includes:

  • replacing git checkout -b with git switch -c
  • replacing git checkout HEAD <file> with git restore <file>
  • updating output of git status with unstaged changes to mention git restore <file> instead of git checkout -- <file>
  • updating output of git status staged changes to mention git restore --staged <file> instead of git reset HEAD <file>
  • removing the section 'Don't lose your HEAD' on detached HEAD states: should never happen when using git restore
  • updating SVG files to mention git restore instead of git checkout
  • updated exercise from git checkout to git restore (-s), including explanation

Copy link

github-actions bot commented Jun 26, 2024

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:

  • 🎯 correct output
  • 🖼️ correct figures
  • ❓ new warnings
  • ‼️ new errors

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:

 03-create.md                 |   2 +-
 04-changes.md                |   4 +-
 05-history.md                | 134 +++++++++++++------------------------------
 07-github.md                 |   9 +--
 fig/git-restore.svg (new +x) | 111 +++++++++++++++++++++++++++++++++++
 fig/git_staging.svg          |   2 +-
 md5sum.txt                   |   8 +--
 7 files changed, 165 insertions(+), 105 deletions(-)
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

github-actions bot pushed a commit that referenced this pull request Jun 26, 2024
Copy link
Contributor

@svenvanderburg svenvanderburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @sjvrijn !!! 🙏 I have been longing for this for a long time now!

I left a small suggestion, otherwise looks great. It does not fully fix #5 right? Since we still have some git checkout commands that should be replaced with git switch? Or maybe you can open a separate issue for that?

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
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point 👍

@sjvrijn
Copy link
Contributor Author

sjvrijn commented Aug 5, 2024

@svenvanderburg which checkout references am I still missing? I can't find any more when I search for 'checkout' in the episodes

github-actions bot pushed a commit that referenced this pull request Aug 5, 2024
@svenvanderburg
Copy link
Contributor

@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 git switch, but that will solve it self! Cool, ready to merge then! (I don't think we will have to wait for Olga, but I leave that up to you!)

@sjvrijn sjvrijn merged commit a1e60de into main Aug 5, 2024
3 checks passed
@sjvrijn sjvrijn deleted the 5-replace-checkout-references branch August 5, 2024 09:55
github-actions bot pushed a commit that referenced this pull request Aug 5, 2024
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`
github-actions bot pushed a commit that referenced this pull request Aug 5, 2024
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`
github-actions bot pushed a commit that referenced this pull request Aug 6, 2024
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`
github-actions bot pushed a commit that referenced this pull request Aug 13, 2024
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`
github-actions bot pushed a commit that referenced this pull request Aug 20, 2024
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`
github-actions bot pushed a commit that referenced this pull request Aug 27, 2024
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`
github-actions bot pushed a commit that referenced this pull request Sep 3, 2024
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`
github-actions bot pushed a commit that referenced this pull request Sep 10, 2024
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`
github-actions bot pushed a commit that referenced this pull request Sep 17, 2024
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`
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

Successfully merging this pull request may close these issues.

Replace checkout with switch/restore
2 participants