How to use Git? - Part 1 - Basics
Hey, this is Henry Godman speaking, (well, more writing!), I’ll learn you how to use the basics of Git.
First part - setting up
For now, we wll use GitHub with Codespaces, this way it already sets up Git so you don’t have to worry about that.
- Create a GitHub repository, name it what you want.
- Make sure to initialize with a README.
- Click the green “code” button, go to “Codespaces” tab and press “Create Codespaces on main”
Second part, commit & pushing
Right now for the challenge we are gonna use the Terminal! Not to make your changes, but to commit and push.
- Do some changes (create files, edit files, rename files, move files, delete files, etc…)
- Focus on the terminal, this is a Linux Terminal, Codespaces usually run Ubuntu.
- In the terminal, write
git add .you should see no output. - After that, write
git commit -m "your commit msg"(Note: Your commit message can be whatver you want.) You should see an output like:[main 1c0ed5e] update pages 3 files changed, 12 insertions(+), 13 deletions(-) delete mode 100644 _posts/2025-7-30-test.md create mode 100644 _posts/2025-7-31-welcome.mdThat’s good, it means it works.
- If you go back to your GitHub repo, you can see that your commit is not here! But don’t worry you just need to push it by writing
git push - And now if you go back, you can see that your commit was successfully pushed!
And that’s all for now! Next were gonna learn how to set up Git in another environement like MSYS2, Git Bash or Termux.
- Previous Post
- Next Post