DEV Community

Christian
Christian

Posted on

The Odin Project Git Basics What I learned

I just finished the Git Basics on The Odin Project and this is what I learned!

I went to github.com and created a repository. I also added a README.md file to it and made my first commits using the Odin Project.

I then opened the terminal and made a directory by typing mkdir Repos for repositories that I create. I then changed my directory to git_test, the repository I made, using cd git_test.

I then created a file inside that directory using git add hello_world.txt. Afterwards, I typed code . and it opened up VS Code with the repository I was in, called git_test.

It looked like this: (~ % Git_test code .). I then made an edit to the README file and added the text “This is my first Odin text file”. To save this change, I used cmd + s on Mac and then I went back to the terminal and did git add README.md.

Then, to check the status, since Git works in a two-stage process, I used git status to see if it was in staging, which means it is waiting to be committed and added to the repository.

I then typed git add . to commit the changes I made to the README.md. This committed the changes to my repository on GitHub and now I have a green streak, which shows that I committed today.

To see everything that happened, I used git log to see me adding the file, staging the file, and committing the file.

That’s what I learned today using the Odin Project Git Basics curriculum.

Top comments (0)