2.2 Practical
Create and edit some files
Let’s test out using git in our Codespaces virtual machine!
Follow along as we create some files, make some edits, and add and commit them to our repository!
Our git workflow
Remember our git cycle:
- We create/modify/edit files
- We add our changes (once, twice, many times) (
git add <filename>) - We commit our bundle of changes (
git commit -m "message here") - We repeat this cycle!
Tipgit hints
- Create and edit files and folders
- Run
git statusto check what changes you’ve made and to see the state of the files - Run
git add filenameto add the changes in a file- You can add files in sub-folders too:
git add sub-folder/filename - You can also add multiple files:
git add filename1 filename2 subfolder/filename3
- You can add files in sub-folders too:
- Run
git statusto check the state of the files - Commit your bundle of files with a short message with
git commit -m "message goes here" - You can also just run
git commitand a text editor will open for you to write a commit message - Run
git statusto check the state of the files