You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
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 HEAD2 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
transferred this issue from esciencecenter-digital-skills/good-practices-in-research-software-development
Sep 16, 2024
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.
The text was updated successfully, but these errors were encountered: