(OPTIONAL) Demo - Take a Look Under the Hood of Git
NOTE: This is an optional demo intended to help provide some understanding of what is actually happening with your git repo "under the hood". You do not need to know this. However knowing a little more about the "magic" that happens with git, can help make other concepts like merging and branching less scary. You may wish to refer back to this demo throughout your studies.
In this demo you are going to get a very high level understanding of what's actually happening inside of your local git repository when you use different git commands.
Notes about following along:
- This demo is completely standalone (it is not required by other demos)
- You will need Git, a text editor, and a CLI (like bash, PowerShell, etc)
- I will use Mac and VS Code with the Terminal, but you can use any editor you are familiar with, and any operating system supported by Git
- We will talk more about branches and merging later, for now we're just looking at what happens on your computer when performing commands
- (Reminder) Make sure you have already setup your git config:
- User name:
git config --global user.name "your name"
git config --global user.email "[email protected]"
- User name:
- Initialize a git repository in a new folder:
- Create a new file, and stage it:
git add --all
- Commit to your repo:
git commit -m "this is my commit message"
- View commits you've created:
- Create a branch:
git branch branchname
- View branches:
git branch -v