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

Strip off lesson materials that we do not teach #21

Open
lyashevska opened this issue Jun 26, 2024 · 1 comment
Open

Strip off lesson materials that we do not teach #21

lyashevska opened this issue Jun 26, 2024 · 1 comment

Comments

@lyashevska
Copy link
Contributor

It is very hard to stay on time while teaching https://github.com/esciencecenter-digital-skills/git-lesson We should remove all unrelated/advanced stuff.

@svenvanderburg
Copy link
Contributor

For episode 5 these are my notes:

Goal: Know that all commits are stored in your history. If you make a mess you can always go back, but you don’t have to remember the details how to do that exactly as long as you remember that it is possible! I will teach you a few important concepts and then you can google your way out of a mess!

image

Put the picture on the screen: There are 2 ways of referring to a commit:
• Relative to HEAD, where HEAD is an identifier for the most recent commit
• The commit ID -> a unique randomly assigned string, also called a commit hash
So let’s say we want to see the differences between HEAD2 and current state:
• git diff HEAD
2 mars.txt
• git log
• git diff commit ID mars.txt
• git show commit ID mars.txt -> to see the file of that version of the software
Now let’s revert history
• git checkout commit ID mars.txt -> to set staging area to version of that commit
• git status
• git checkout HEAD mars.txt -> to go to most recent commit
Important: you never actually change history. You add another commit that changes the state to an older version.
Do exercises individually!

@lyashevska lyashevska transferred this issue from esciencecenter-digital-skills/good-practices-in-research-software-development Sep 16, 2024
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