From f3f3ba221be411f927aacc8996db35fde24e311d Mon Sep 17 00:00:00 2001 From: ImAlpha Date: Sun, 2 Apr 2023 21:17:03 -0700 Subject: [PATCH] finished git section --- TheOdinProjectNotes.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/TheOdinProjectNotes.md b/TheOdinProjectNotes.md index dc912e5..b49b592 100644 --- a/TheOdinProjectNotes.md +++ b/TheOdinProjectNotes.md @@ -53,4 +53,23 @@ cat ~/.ssh/id_ed25519.pub ``` git remote set-url origin https://'username':'password'@repositorylink ``` +## Using Git +- Check git version by using ```git --version``` +- After creating a new repository you can clone it to your current directory by using ``` git clone ``` +- After the cloning, check the url with ```git remote -v``` +- Use ```git status``` to check the status of the current files within your directory +- To commit to the repo you can use ```git commit -m "Add helloworld.txt"``` +- Confirm with ```git status``` +- You can use ```git log``` to view the most recent commits +- After creating a file you can use ```git add ``` to add that specific file or ```git add .``` to add all files within the directory that are not on the repo +- We can push the changes to the cloud repository with ```git push origin main```, origin being the remote location and *main* being the branch to upload to + - Make sure to only push working code +# Git Best Practices +- Atomic commits + - A commit that includes changes related to only one feature or task of your program. + - Easily reversible if the commit causes breaking changes + - Enables you to write more specific commit messages +# Changing the Git Commit Message Editor +- Typing ```git config --global core.editor "code --wait"``` into the terminal will give you the option to use either ```git commit -m ``` or ```git commit``` without anything extra. +## Introduction to HTML And CSS