{ "id": "freeCodeCamp/learn-git-by-building-an-sql-reference-object:v1.0.0", "version": "2.0.0", "summary": { "title": "Learn Git by Building an SQL Reference Object", "description": "> Welcome to the git lessons!" }, "config": { "setup": { "commands": [ "./.freeCodeCamp/setup.sh", "cd .freeCodeCamp && npm install" ], "commits": [ "8012300118d41f88a2d84936d5d802f63b48551f" ] }, "testRunner": { "command": "npm run programmatic-test", "args": { "tap": "--reporter=mocha-tap-reporter" }, "directory": ".freeCodeCamp" }, "repo": { "uri": "https://github.com/freeCodeCamp/learn-git-by-building-an-sql-reference-object", "branch": "v2.0.0" }, "continue": { "commands": [ "./.freeCodeCamp/setup.sh", "./.freeCodeCamp/reset.sh" ] }, "reset": { "commands": [ "./.freeCodeCamp/setup.sh", "./.freeCodeCamp/reset.sh" ] }, "dependencies": [ { "name": "node", "version": ">=10" } ], "webhook": { "url": "https://api.freecodecamp.org/coderoad-challenge-completed", "events": { "init": false, "reset": false, "step_complete": false, "level_complete": false, "tutorial_complete": true } } }, "levels": [ { "id": "10", "title": "Start Terminal", "summary": "", "content": "", "steps": [ { "id": "10.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "db2144b367d57d5d4d14ac278c962a377ec654e4" ] }, "content": "The first thing you need to do is start the terminal. Open a new one by clicking the \"hamburger\" menu at the top left of the window, going to the \"terminal\" section, and clicking \"new terminal\". Once you open a new one, type `echo hello git` into the terminal and press enter.", "hints": [ "Follow the directions closely", "If the tests don't pass, trash all the terminals with the trash can icon at the top right of the terminal. Then, redo those instructions" ] } ] }, { "id": "20", "title": "Make Directory", "summary": "", "content": "", "steps": [ { "id": "20.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "50ab85a9a1a4e7c59a819babfb0de788118c551e" ] }, "content": "You should be in the `project` folder in the terminal you opened. Use the terminal to make a new directory named `sql_reference` in the `project` folder. As a reminder, you can use the `mkdir` command to make a new folder.", "hints": [ "Enter `mkdir sql_reference` in the terminal from the `project` folder", "Enter `cd ~/project` to get to the `project` folder if you aren't there", "Don't try to create the folder with another method" ] } ] }, { "id": "30", "title": "Change Directory", "summary": "", "content": "", "steps": [ { "id": "30.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "3c40a17407ea3d150832c3884d9439c12c9430f8" ] }, "content": "Use the \"change directory\" command in the terminal to change to your new folder.", "hints": [ "Enter `cd sql_reference` into the terminal", "Make sure you are in the `project` folder first", "Enter `cd ~/project` to get to the `project` folder if you aren't there" ] } ] }, { "id": "40", "title": "Initialize a git Repository", "summary": "", "content": "", "steps": [ { "id": "40.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "77611186e7a6f420d0638a957c0b2b5013edaf25" ] }, "content": "Git is a version control system to keep track of your code. This folder will be your git repository. Turn it into one by typing `git init` in the terminal from this folder.", "hints": [ "Enter `git init` into the terminal while in the `sql_reference` folder", "Make sure you are in the `sql_reference` folder first", "Enter `cd ~/project/sql_reference` to get to the folder if you aren't there" ] } ] }, { "id": "50", "title": "View .git Folder", "summary": "", "content": "", "steps": [ { "id": "50.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "48a34594b66d1f297e04ca739d1842b619dae987" ] }, "content": "Use the list command with the `-a` flag to list the hidden folders and files.", "hints": [ "The list command is `ls`", "Type `ls -a` into the terminal and press enter", "Make sure you are in the `sql_reference` folder first", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "60", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "60.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "65b3942553e586507a0084536d14032b5b305bc7" ] }, "content": "The `git init` command created that `.git` folder for you. It's what keeps track of all the things in your repository. Use `git status` to see the status of where you are. This command will be your best friend.", "hints": [ "Type `git status` into the terminal and press enter", "Make sure you are in the `sql_reference` folder first", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "70", "title": "Checkout main Branch", "summary": "", "content": "", "steps": [ { "id": "70.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "26dbe528fcd1220ffa7df24671fb7afc72190b8f" ] }, "content": "A git repository has branches to help keep track of things you are doing with your code. It's common to have a `main` branch which might be for your production code, and other branches for adding new features or fixing bugs. You can create and go to a new branch with `git checkout -b new_branch`. The `-b` stands for \"branch\". Use that command to switch to a new branch named `main`.", "hints": [ "Capitalization matters", "Type `git checkout -b main` into the terminal", "Make sure you are in your `sql-reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "80", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "80.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "afcf0eb74841aaf89da04cc6d4fb90ceecac3ce6" ] }, "content": "Check your status again with `git status`.", "hints": [ "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "90", "title": "touch README.md", "summary": "", "content": "", "steps": [ { "id": "90.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "471fb8b52c052cdcee15f2c6779bcdd9cb8fedf0" ] }, "content": "Now you are on the `main` branch. Use the `touch` command to create `README.md` inside your repository. This is a file you will see in many repos to describe what the repo is for.", "hints": [ "Use `touch file_name` to create a file", "Type `touch README.md` into the terminal and press enter", "Don't try to create the file with another method", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "100", "title": "Add Readme Text", "summary": "", "content": "", "steps": [ { "id": "100.1", "setup": { "watchers": [ "./sql_reference/README.md" ], "commits": [ "104cb38a6ffc6b22438426b36cbccbe644fe9ebb" ] }, "content": "Add the text `SQL Reference` at the top of your new file to let people know what your repo is for.", "hints": [ "Add the suggested text in your `README.md` file" ] } ] }, { "id": "110", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "110.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "4dc65b915f010d19d979f756cd7fc26d43691b88" ] }, "content": "Check the status of your repo again.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "120", "title": "git add README.md", "summary": "", "content": "", "steps": [ { "id": "120.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "6987a4dd4a430adae7244a688ae8152c061ee9b4" ] }, "content": "The file you created has not been added to git yet so it is showing that it is untracked. There's two steps to make git keep track of it for you. First you need to add it to the staging area like this: `git add file_name`. Add your `README.md` file to the staging area.", "hints": [ "Replace `file_name` in the example with your `README.md` file", "Type `git add README.md` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "130", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "130.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "c41fab1eb5a8fee513b1dcd53a56b6aa4ca1088e" ] }, "content": "Check your status again.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "140", "title": "touch sql_reference.json", "summary": "", "content": "", "steps": [ { "id": "140.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "15091ddbc94c6be0c012a57709770eb8b21e7242" ] }, "content": "Now your file is in staging and will be added with the next commit. You aren't quite ready to commit this yet though. Use `touch` again to create `sql_reference.json` in your repo.", "hints": [ "Use `touch file_name` to create a file", "Type `touch sql_reference.json` into the terminal and press enter", "Don't try to create the file with another method", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "150", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "150.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "992f3f42a6fcd26099464089b8cccbbce4ae2863" ] }, "content": "Check your status again.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "160", "title": "git add Initial commit", "summary": "", "content": "", "steps": [ { "id": "160.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "728c90de0b86bdd07dce7422da594705bc14aac2" ] }, "content": "You now have one file in staging and one that is untracked. Add the new file you created to the staging area.", "hints": [ "Here's the example again: `git add file_name`", "You added the last one with `git add README.md`", "Type `git add sql_reference.json` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "170", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "170.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "299f7a0a2b47bc09283582e682003d177dd7e0b0" ] }, "content": "Check your status one more time please :grin:", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "180", "title": "git commit Initial commit", "summary": "", "content": "", "steps": [ { "id": "180.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "24752cde5aa8bca38558b0bead01778fff33886f" ] }, "content": "Now you have two files in staging. To commit them, you can use `git commit -m \"Initial commit\"`. The `-m` stands for \"message\". Often times, the first commit of a repo will have the message \"Initial commit\". Commit your two files with the message `Initial commit`.", "hints": [ "Type `git commit -m \"Initial commit\"` in the terminal and press enter", "Enter `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "190", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "190.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a913cafd67a9b52b5ec205090434484879fec6ed" ] }, "content": "When you make a commit, whatever is in the staging area will be added to your git history. You can see some info in the terminal output about the commit. Check your status again to see what's there.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "200", "title": "git log", "summary": "", "content": "", "steps": [ { "id": "200.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "38b9c70a70ad1b528423a2e8bc8173cf4a1e9163" ] }, "content": "Your \"working tree\" is clean, the files were committed and there's no other new changes that git recognizes. You can see your commit history with `git log`. Check your commit history.", "hints": [ "Type `git log` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "210", "title": "Add CREATE DATABASE Command", "summary": "", "content": "", "steps": [ { "id": "210.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "e9144cfcf045dc35873e71bcf844bde39e16966f" ] }, "content": "You can see the commit you made. It shows the message you gave with the commit, along with your username, email, the date, and a commit hash. The hash is that long string of characters. Open up your `.json` file and create an object with a reference for how to create a database that looks like this:\n\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\"\n }\n}\n```\n\nMake sure there's one empty line at the bottom of the file and no extra spaces after the value or any of the curly brackets.", "hints": [ "Add the suggested object to your `sql_reference.json` file", "Double check for those extra spaces and the empty line" ] } ] }, { "id": "220", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "220.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "2eef279583896ed1f37c56ba850a59a2bcbdb8db" ] }, "content": "Check your status again.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "230", "title": "git diff", "summary": "", "content": "", "steps": [ { "id": "230.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "9baaaa9b259a76ff1fa86a4b775bd893be6a529f" ] }, "content": "Git recognizes new unstaged changes to your file. Notice that it says that file is modified instead of untracked because the file has been previously committed. You can see the changes you made with `git diff`. Take a look at the new changes.", "hints": [ "Type `git diff` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "240", "title": "git add sql_reference.json", "summary": "", "content": "", "steps": [ { "id": "240.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "6043fa29607a7bd43c055bf38b3333694bc4c9d8" ] }, "content": "The lines with `+` in front means that those lines were added. Add your new changes to staging with the `git add` command again. Make sure to put the filename you want to add at the end of the command.", "hints": [ "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "250", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "250.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "d4d53392a9507144157c08f44d4f9e1fa24491ea" ] }, "content": "Check your status.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "260", "title": "git commit feat: add create database reference", "summary": "", "content": "", "steps": [ { "id": "260.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a4ffedc9dc38cd76ebc429a5d60972d9a9815dd2" ] }, "content": "Your new changes are staged and ready to be committed. Commit them with the message `feat: add create database reference`. As a reminder, here what the command to commit looks like: `git commit -m \"message\"`.", "hints": [ "Type `git commit -m \"feat: add create database reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "270", "title": "git log", "summary": "", "content": "", "steps": [ { "id": "270.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "92583e885279b63506e31fe1b7bf880c25068384" ] }, "content": "Commit messages often start with `fix:` or `feat:`, among others, to help people understand what your commit was for. Check your `git log` again to see the new commit added.", "hints": [ "Type `git log` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "280", "title": "Add DROP DATABASE command", "summary": "", "content": "", "steps": [ { "id": "280.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "8a7efc4bb42d31970384742d84525c68cba131b5" ] }, "content": "Now there's two commits in your history, the newest one is at the top :smile: In your JSON file, add a `drop` key to your `database` object. Give it a value for how to drop a database similar to the `create` value. The syntax is in the hints. Again, make sure there's an empty line at the bottom of the file and no extra spaces after any values or curly brackets.", "hints": [ "The value should be `\"DROP DATABASE database_name;\"`", "Don't forget the comma at the end of the previous line to make it a valid json object.", "Your database object should have these values:\n```json\n{\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "290", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "290.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "eeafa19d17e603f4c8fe8e297b3ccde30735e357" ] }, "content": "Check your status.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "300", "title": "git diff", "summary": "", "content": "", "steps": [ { "id": "300.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "437ad884574fdb05a9ce38aee7dbf56695be4eb4" ] }, "content": "Changes not staged. Check the `diff` quick.", "hints": [ "Use the \"git diff\" command in your repo", "Type `git diff` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "310", "title": "git add DROP DATABASE command", "summary": "", "content": "", "steps": [ { "id": "310.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "34632cafdb40774dcb93f474d6e91b382909ad1f" ] }, "content": "It should show one line removed and two lines added. Add your changes to the staging area.", "hints": [ "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "320", "title": "git commit feat: add drop database reference", "summary": "", "content": "", "steps": [ { "id": "320.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "e90a98ea53203bcc977492c0ed38c9dd02655435" ] }, "content": "Commit your staged changes with the message, `feat: add drop database reference`", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add drop database reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "330", "title": "git log", "summary": "", "content": "", "steps": [ { "id": "330.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "00778ffb0a770b8984851302b4feb62552c9fcee" ] }, "content": "I think you're catching on :smile: Check the `log` again.", "hints": [ "Type `git log` into the terminal and press enter", "Press `enter` in the terminal to go through the whole log", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "340", "title": "git branch", "summary": "", "content": "", "steps": [ { "id": "340.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "e404a6e0a1918413a8825c14dd5d0b4427bdd7be" ] }, "content": "Now there's three commits :smile: You have been making changes to your `main` branch. You actually want to try and avoid that. Type `git branch` to see the current branches in your repo.", "hints": [ "Type `git branch` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "350", "title": "git branch feat/add-create-table-reference", "summary": "", "content": "", "steps": [ { "id": "350.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a416ba3f357101a5a70ce07fddb403f4053e32a4" ] }, "content": "You only have the `main` branch still. You can create a branch with `git branch branch_name`. Branches often start with `fix/` or `feat/`, among others, like commit messages, but they use a forward slash and can't contain spaces. Create a new branch named `feat/add-create-table-reference`.", "hints": [ "Type `git branch feat/add-create-table-reference` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "360", "title": "git branch", "summary": "", "content": "", "steps": [ { "id": "360.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "c1d7b23bf499498b71a23d25e60ca19f4e88a8b4" ] }, "content": "Your new branch is a clone of the `main` branch since that's the branch you were on when you created it. It will have the same code and commit history as `main` did at the time of the branch creation. View your branches again with `git branch`.", "hints": [ "Type `git branch` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "370", "title": "git checkout feat/add-create-table-reference", "summary": "", "content": "", "steps": [ { "id": "370.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "1e69791142d25921265bbba176a1585472104a5a" ] }, "content": "You can see your new branch, but you are still on the `main` branch, as denoted with the `*`. To switch to a branch use: `git checkout branch_name`. Switch to your new branch.", "hints": [ "Type `git checkout feat/add-create-table-reference` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "380", "title": "git branch", "summary": "", "content": "", "steps": [ { "id": "380.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "b5b3d0dac98772d26a75166bee1ae43c56dcec92" ] }, "content": "It says you switched to your new branch. Type `git branch` so I can make sure the `*` switched.", "hints": [ "Type `git branch` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "390", "title": "Add CREATE TABLE Command", "summary": "", "content": "", "steps": [ { "id": "390.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "87c5d7748dc84d2d768b2bc672219f68cc39d1b9" ] }, "content": "Like I said, you often don't want to make commits directly to the main branch of a repo. This branch will be for some new changes. What you will do is make the changes and commits here, then merge them into the `main` branch when they are ready. Add a reference for creating an SQL table to your json file along side your `database` property. Make it look like this:\n\n```json\n\"table\": {\n \"create\": \"CREATE TABLE table_name;\"\n}\n```", "hints": [ "Make sure to add commas to keep it a valid json object", "The `table` key should be on the same level as the `database` key", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "400", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "400.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "7c9e68bcbf238b12d7c296d65198732e3b2df074" ] }, "content": "Show me the status again. You might as well get used to it :smiley_cat:", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "405", "title": "git diff", "summary": "", "content": "", "steps": [ { "id": "405.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "0b88c10ccca2b794b476a51034532ac71871f299" ] }, "content": "Changes not staged. Check the `diff` quick so you can make sure your changes look good.", "hints": [ "Use the \"git diff\" command in your repo", "Type `git diff` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "410", "title": "git add CREATE TABLE reference", "summary": "", "content": "", "steps": [ { "id": "410.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "fa3bd97189e1f6862f92f1e2c3d89458053d08de" ] }, "content": "You made new changes so the file shows up as not staged. Add the file to staging so you can commit the changes.", "hints": [ "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "420", "title": "git commit feat: add create table reference", "summary": "", "content": "", "steps": [ { "id": "420.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "d1f0e42f6098a45856d716866609cb8a8f5ab31d" ] }, "content": "The changes are now in staging. Commit your staged changes with the message `feat: add create table reference`.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add create table reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "430", "title": "git log", "summary": "", "content": "", "steps": [ { "id": "430.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "db3c6db23434c63f84d73853041d70cfd567765a" ] }, "content": "Check your `git log` again.", "hints": [ "Type `git log` into the terminal and press enter", "Press `enter` in the terminal to go through the whole log", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "435", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "435.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "7b4cf6113280e8bcea0b31c2767f4b9deef0eb6b" ] }, "content": "Now you have four commits, they are getting a little hard to see. Check the log again, but this time use the `--oneline` flag to condense the output so it's more readable.", "hints": [ "Type `git log --oneline` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "440", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "440.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "f41203347256ee74727be08537cae5530ac7b7d3" ] }, "content": "That's better. Use `git checkout` to switch back to the `main` branch.", "hints": [ "Use `git checkout branch_name` to switch to a branch", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "450", "title": "git log", "summary": "", "content": "", "steps": [ { "id": "450.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "960d293afb6bcf63f9613e0cd13519d22d510a51" ] }, "content": "You may have noticed that the code you added disappeared from the JSON file. Your changes were added on the `feat/add-create-table-reference` branch so they don't exist on this branch. Check the log of the main branch, use the `--oneline` flag again.", "hints": [ "Type `git log --oneline` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "460", "title": "git branch", "summary": "", "content": "", "steps": [ { "id": "460.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "6bd11a397b0c1a07c8834b360fd440260f820d3d" ] }, "content": "You can see three commits on this branch and four on the feature branch you were just on. The commit and code you added on the feature branch only exist over there for now. View the branches you have to remind me the name of your other branch.", "hints": [ "Type `git branch` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "470", "title": "git merge feat/add-create-table-reference", "summary": "", "content": "", "steps": [ { "id": "470.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "d234f653e3353c41effef1174a2e112ccf98cc59" ] }, "content": "You created the `feat/add-create-table-reference` branch, made a commit, and now it's ready to be added to the `main` branch. You can use `git merge branch_name` to bring changes from a branch into the branch you are currently on. Merge the changes from your feature branch into the `main` branch.", "hints": [ "Type `git merge feat/add-create-table-reference` into the terminal and press enter", "Make sure you enter the command while on the `main` branch" ] } ] }, { "id": "480", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "480.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "b1f405d3ff7afe0a46fbb2e354a2f52a0196edad" ] }, "content": "The commits and code from your feature branch were added to this branch. There's a message with some info about the merge. Check the log with the `--oneline` flag again.", "hints": [ "Use the `git log` command with the correct flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "490", "title": "git branch -d feat/add-create-table-reference", "summary": "", "content": "", "steps": [ { "id": "490.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "8225f6c367d5eb467528fe7658276469231fd7e4" ] }, "content": "The `feat: add create table reference` commit you made on your feature branch was added to this branch with the merge. You can delete a branch with `git branch -d branch_name`. `-d` stands for \"delete\". Since your changes were added, you can safely delete your feature branch. Do that now.", "hints": [ "The branch name is `feat/add-create-table-reference`", "Type `git branch -d feat/add-create-table-reference` into the terminal and press enter" ] } ] }, { "id": "500", "title": "git branch", "summary": "", "content": "", "steps": [ { "id": "500.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "31ad1a3b42044c642cb7d5cabaa850c2c3280fc7" ] }, "content": "It said it was deleted, but view your branches again for me to verify that it's gone.", "hints": [ "Type `git branch` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "510", "title": "git checkout -b feat/add-drop-table-reference", "summary": "", "content": "", "steps": [ { "id": "510.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "4f75873203da70050d4b9b3627bc402245ee7f47" ] }, "content": "You're just left with the `main` branch... Want to try it again? Last time you created a branch and then switched to it. You can do both at the same time with `git checkout -b branch_name`. Create and switch to a new branch named `feat/add-drop-table-reference`.", "hints": [ "Type `git checkout -b feat/add-drop-table-reference` into the terminal and press enter" ] } ] }, { "id": "520", "title": "Add DROP TABLE Command", "summary": "", "content": "", "steps": [ { "id": "520.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "ce9a04237c303e3749587031ab5cfac8670f3cac" ] }, "content": "Add a `drop` key to the `table` object of your JSON file. Give it a value for how to drop a table. The syntax is in the hints.", "hints": [ "The value should be `\"DROP TABLE table_name;\"`", "Don't forget the commas to make it a valid json object", "The key looks like this: `\"drop\": \"DROP TABLE table_name;\"`", "The `table` object should look like this:\n```json\n\"table\": {\n \"create\": \"CREATE TABLE table_name;\",\n \"drop\": \"DROP TABLE table_name;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name;\",\n \"drop\": \"DROP TABLE table_name;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "530", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "530.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "4ff881182a6ce5d0f15a034401fbb5da815bff7f" ] }, "content": "Check your status.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "535", "title": "git diff", "summary": "", "content": "", "steps": [ { "id": "535.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "96f45a2004b9f219299f5ec74c473e3148fbe249" ] }, "content": "Check the `diff` so you can confirm you like your changes.", "hints": [ "Use the \"git diff\" command in your repo", "Type `git diff` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder", "Enter `cd ~/project/sql_reference` to go to the folder if you aren't there" ] } ] }, { "id": "540", "title": "git add DROP TABLE command", "summary": "", "content": "", "steps": [ { "id": "540.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "0908b41f924e52e169dcc89a9752cffb9f397bb5" ] }, "content": "Add your changes to staging.", "hints": [ "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "550", "title": "git commit feat: add drop table reference", "summary": "", "content": "", "steps": [ { "id": "550.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "1cd493556a1055f56af23b3289260abcb283de39" ] }, "content": "Commit your staged changes with the message `feat: add drop table reference`.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add drop table reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "560", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "560.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "728061227625c4b01bcd48acccf81bd8726fcccd" ] }, "content": "Switch back your `main` branch so you can merge in these changes.", "hints": [ "Use `git checkout branch_name` to switch to a branch", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "570", "title": "git branch", "summary": "", "content": "", "steps": [ { "id": "570.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "316e60137716c5df13ddbdcf736a795e8706ff35" ] }, "content": "Remember that the code and commit you added aren't on this branch, so they disappeared again. View the branches on your repo so you can get the name of it to merge your feature into the main branch.", "hints": [ "Use `git branch` to view your branches", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "580", "title": "git merge feat/add-drop-table-reference", "summary": "", "content": "", "steps": [ { "id": "580.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "bb2bc63beed63903abba3e27ba27f72945311a8f" ] }, "content": "Merge your feature branch into the `main` branch.", "hints": [ "Here's an example: `git merge branch_name`", "The command will merge `branch_name` into whatever branch you are on", "Type `git merge feat/add-drop-table-reference` into the terminal and press enter", "Make sure you enter the command while on the `main` branch" ] } ] }, { "id": "590", "title": "git branch -d feat/add-drop-table-reference", "summary": "", "content": "", "steps": [ { "id": "590.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "9e243063aa76c9d4a99c7fbe8316c85524667341" ] }, "content": "The commit from your feature branch was added to the `main` branch so you can safely delete the feature branch. Delete your feature branch.", "hints": [ "Use the `git branch` command with the `-d` flag to delete a branch", "Use the \"git branch\" command to find the branch name", "The branch name is `feat/add-drop-table-reference`", "Here's an example: `git branch -d branch_name`", "Type `git branch -d feat/add-drop-table-reference` into the terminal and press enter" ] } ] }, { "id": "600", "title": "git checkout -b feat/add-column-references", "summary": "", "content": "", "steps": [ { "id": "600.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "e2cd62fcf187ca40cc8221aededbd063705c732a" ] }, "content": "You're getting the hang of it :smile: The process is to create a branch, make the changes you want, commit them, and then merge the changes into branch you started on. Pretty simple, lets keep going. Create and checkout a new branch named `feat/add-column-references`", "hints": [ "You can create and checkout a branch with `git checkout -b branch_name`", "Type `git checkout -b feat/add-column-references` into the terminal and press enter" ] } ] }, { "id": "610", "title": "Add ADD COLUMN command", "summary": "", "content": "", "steps": [ { "id": "610.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "16cacaa58ac863067aa299921b66a08119e437f3" ] }, "content": "This branch will be a work in progress. Add a `column` key to your JSON object. Make it an object like the other two. Give it a single property, `add`, that has the value `\"ALTER TABLE table_name ADD COLUMN column_name;\"`.", "hints": [ "The `column` key should be on the same level as the `table` key", "The `column` object should look like this:\n```json\n\"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name;\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "620", "title": "git diff", "summary": "", "content": "", "steps": [ { "id": "620.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "e2027c44d906e6b5c079ac9e3cf3ad2d90e1a14b" ] }, "content": "View the `diff` to make sure your new changes are what you expect.", "hints": [ "Use the \"git diff\" command", "Type `git diff` into the terminal and press enter", "Make sure you are in your repo folder first" ] } ] }, { "id": "630", "title": "git add ADD COLUMN command", "summary": "", "content": "", "steps": [ { "id": "630.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "e4fac50672af077381983bdba0a16fe2183ce6cd" ] }, "content": "Add your changes to staging. Here's a tip: you can use `git add .` to add all files to staging.", "hints": [ "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "640", "title": "git commit feat: add column reference", "summary": "", "content": "", "steps": [ { "id": "640.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "71da3d7190d3d9ee42a890771ee029907afacafb" ] }, "content": "Commit your staged changes with the message `feat: add column reference`.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add column reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "650", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "650.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "6d96f89c6229b2007c539ce093f18e4f9da58e74" ] }, "content": "View your log with the oneline flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "670", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "670.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "aa7d70f9da90e865ba0c31ff6b97a66c13517a4a" ] }, "content": "The commit was added. I see an error in the syntax of one of the commands. You want to fix it, but this branch is not for fixing it. Switch back to your `main` branch so you can create a new branch to fix it.", "hints": [ "Use `git checkout branch_name` to switch to a branch", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "680", "title": "git checkout -b fix/create-table-syntax", "summary": "", "content": "", "steps": [ { "id": "680.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "db88d59b70446b66aea4aba81366d912453e7791" ] }, "content": "Remember that, when you create a branch, it will be a clone of whatever branch you are on when you create it. That's why you switched to `main` first. Create and switch to a branch named `fix/create-table-syntax`.", "hints": [ "Here's an example: `git checkout -b branch_name`", "Type `git checkout -b fix/create-table-syntax` into the terminal and press enter" ] } ] }, { "id": "690", "title": "Fix CREATE TABLE syntax", "summary": "", "content": "", "steps": [ { "id": "690.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "ddf0098426c741bba47dbeb69deb7341c05b3a50" ] }, "content": "The create table command is a function, so it needs parenthesis `()` at the end. Add those to the end of the command.", "hints": [ "It's the `table.create` key that you need to change", "The value should look like this: `CREATE TABLE table_name();`", "The `table` object should look like this:\n```json\n\"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "700", "title": "git add FIX CREATE TABLE command", "summary": "", "content": "", "steps": [ { "id": "700.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "290ff9d1224419e5b0ba619656682737ac3e7848" ] }, "content": "Check your status and diff to see your new changes. Then, add your files to staging.", "hints": [ "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "710", "title": "git commit fix: create table syntax", "summary": "", "content": "", "steps": [ { "id": "710.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "19b3f62b68a70dcea3c03a86ce805fa630694994" ] }, "content": "Commit your changes with the message `fix: create table syntax`.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"fix: create table syntax\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "720", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "720.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "fd7ccf38c36a0dc511a3b7e012b6d1e95b00e71e" ] }, "content": "Switch back to your `main` so you can merge this important bug fix.", "hints": [ "Use `git checkout branch_name` to switch to a branch", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "730", "title": "git branch", "summary": "", "content": "", "steps": [ { "id": "730.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "3cd2e1a48e34dbf4ef20f67a82aaf5a0736647f5" ] }, "content": "View your branches to remind me of the branch name.", "hints": [ "Use `git branch` to view your branches", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "740", "title": "git merge fix/create-table-syntax", "summary": "", "content": "", "steps": [ { "id": "740.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "05c6014676cfc20d6a8ba187158b3aa8c6d0efe2" ] }, "content": "Merge your bug fix branch into this branch.", "hints": [ "It's the `fix/create-table-syntax` branch", "Here's an example: `git merge branch_name`", "Type `git merge fix/create-table-syntax` into the terminal and press enter" ] } ] }, { "id": "750", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "750.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "4e03765230c98c4bcbfa489e6c28f955a61f2bd5" ] }, "content": "View your log with the oneline flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "755", "title": "git branch -d fix/create-table-syntax", "summary": "", "content": "", "steps": [ { "id": "755.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "0d474f374204bd3485e31026ea3208d0d4762580" ] }, "content": "The bug fix is in and you can safely delete the branch. Go ahead and delete the branch that was for that fix. View your branches if you need to find the name.", "hints": [ "Use the `git branch` command with the `-d` flag", "Here's an example: `git branch -d branch_name`", "The branch name is `fix/create-table-syntax`", "Type `git branch -d fix/create-table-syntax` into the terminal and press enter" ] } ] }, { "id": "760", "title": "git checkout feat/add-column-references", "summary": "", "content": "", "steps": [ { "id": "760.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "e5f9b26759671ce72cf73de8eba8f10c77256d3e" ] }, "content": "Your bug fix is merged into the `main` branch. Switch back to your feature branch so you can continue adding column references.", "hints": [ "Check your branches if you need to get the name of the branch", "You can view your branches with `git branch`", "Use `git checkout branch_name` to switch to a branch", "It's the `feat/add-column-references` branch", "Enter `git checkout feat/add-column-references` into the terminal and press enter" ] } ] }, { "id": "770", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "770.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "3293ea7395e77e0d7d58c79ec415f0d92787e0dd" ] }, "content": "View your log with the oneline flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "780", "title": "git rebase main", "summary": "", "content": "", "steps": [ { "id": "780.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "2b4c77907cae8e75a20b07ad8ccfd23b0749a790" ] }, "content": "You created this branch and made a commit. Since then, a commit for a bug fix was added to `main`. This is common with many people working on a codebase simultaneously. You need to update this branch so it has the same commits from `main`, but you can't just merge that branch into this one. You need that bug fix commit to be in the same order here as it is on `main`, right after the \"drop table\" commit. You need to `rebase` this branch against `main` to do that. Enter `git rebase main` to rebase this branch.", "hints": [ "Type `git rebase main` into the terminal and press enter" ] } ] }, { "id": "790", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "790.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "883166e2c5d63c727a376b0208bda999e20c417c" ] }, "content": "There was some fancy output there, but you can see the parenthesis from the bug fix commit were added to the `table.create` value. Show me the log again with the same flag you have been using so you can see what happened.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "800", "title": "Add DROP COLUMN command", "summary": "", "content": "", "steps": [ { "id": "800.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "fcba959ca8802311f445cad9e26d3328bf555871" ] }, "content": "The logs show that the bug fix commit from `main` was added, and then the commit from this branch was added on top of it. Now, when this branch is ready to be merged into `main`, it will have the same commit history. You should try to keep your branches up to date like this by rebasing them often. In your JSON file, add a `drop` key to the `column` object with a reference for dropping a column. The syntax is in the hints, give it a try first.", "hints": [ "It follows a similar syntax as adding a column", "Don't forget the semi-colon at the end", "Here's the syntax: `ALTER TABLE table_name DROP COLUMN column_name;`", "Make sure the above value is in the `column.drop` key", "Here's what the `column` object should look like:\n```json\n\"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "810", "title": "git add DROP COLUMN command", "summary": "", "content": "", "steps": [ { "id": "810.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "d95cff05f7bc42815f2fe443e119dbd2c712e27e" ] }, "content": "Check your status and diff to see your new changes. Then, add your changes to staging.", "hints": [ "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "820", "title": "git commit feat: drop column reference", "summary": "", "content": "", "steps": [ { "id": "820.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "89e6a5cb10cc7f2fdc8d9991f8d2d0a18857308b" ] }, "content": "Commit your changes with the message: `feat: add drop column reference`.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add drop column reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "830", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "830.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "d40d6835421e036ed425cc2106a4898a446d4337" ] }, "content": "View your log again. Make sure you use my favorite flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "840", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "840.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "b44948e6dc17f50a323f70ccfe3a5989332ca365" ] }, "content": "Switch to your `main` branch, there's another feature that needs to be worked on.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "850", "title": "git checkout -b feat/add-insert-row-reference", "summary": "", "content": "", "steps": [ { "id": "850.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "be14bd1d2f8869c8b6a15ce19fce8ec97d17a9a4" ] }, "content": "Create and switch to a new branch named `feat/add-insert-row-reference`.", "hints": [ "Here's an example: `git checkout -b branch_name`", "Type `git checkout -b feat/add-insert-row-reference` into the terminal and press enter" ] } ] }, { "id": "860", "title": "Add INSERT ROW command", "summary": "", "content": "", "steps": [ { "id": "860.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "e861623be27c622453037e3dbbe4d8bf9902591e" ] }, "content": "Pretend that this branch is for someone else working on a new feature at the same time you are working on the column commands. Add a `row` key to your JSON object. Make it an object with an `insert` key whose value is `\"INSERT INTO table_name(columns) VALUES(values);\"`", "hints": [ "Your JSON object should have this:\n```json\n\"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\"\n}\n```", "The `row` key should be on the same level as the `table` key", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "870", "title": "git add INSERT ROW command", "summary": "", "content": "", "steps": [ { "id": "870.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "57794205628c9d924caf3c3bfabdb55269618619" ] }, "content": "Check your status and diff so you can see your new changes. Then, add your changes to staging.", "hints": [ "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "880", "title": "git commit feat: add insert row reference", "summary": "", "content": "", "steps": [ { "id": "880.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "449a1c0dc7a8e74ffac3215aad60925fe9d31919" ] }, "content": "Commit your changes with the message: `feat: add insert row reference`.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add insert row reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "890", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "890.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "3d78c73f0af7f3bb40cdfb17bb1f5da73a07769b" ] }, "content": "This branch is finished. Switch to your `main` branch so you can merge this commit in.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "900", "title": "git branch", "summary": "", "content": "", "steps": [ { "id": "900.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "6fb5b16efdb6cbe77c784bc572c2eed83d963efb" ] }, "content": "View your branches to find the name of the branch you want to merge.", "hints": [ "Use `git branch` to view your branches", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "910", "title": "git merge feat/add-insert-row-reference", "summary": "", "content": "", "steps": [ { "id": "910.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "b26e2cb9f1bd48b6d02fdd562cb814ecbda1b832" ] }, "content": "Merge your branch with the `insert row` reference you were just working on into the `main` branch.", "hints": [ "Use the `git merge` command", "Here's an example: `git merge branch_name`", "You want to merge the `feat/add-insert-row-reference` branch", "Type `git merge feat/add-insert-row-reference` into the terminal and press enter" ] } ] }, { "id": "930", "title": "git checkout feat/add-column-references", "summary": "", "content": "", "steps": [ { "id": "930.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "f9cbe7744cac7eadee624e26c5b10aa68bed31f7" ] }, "content": "Check your logs to make sure the commit was added. Then, switch to your branch for adding column references.", "hints": [ "Use the \"git branch\" command to find the name of the branch", "Use the `git checkout` command", "The branch you want to switch to is `feat/add-column-references`", "Here's an example: `git checkout branch_name`", "Enter `git checkout feat/add-column-references` into the terminal and press enter" ] } ] }, { "id": "940", "title": "git rebase main", "summary": "", "content": "", "steps": [ { "id": "940.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "42fc419c4fed876cb56104a26d0ec3fc3e0909c5" ] }, "content": "Another commit was added to `main`, you should update this branch again. To be more specific, a rebase will \"rewind\" this branch to where it last matched `main`, then, add the commits from `main` that aren't here. After that, it adds the commits you made to this branch on top. `rebase` this branch against `main` so it's up to date. You should see a conflict...", "hints": [ "Here's an example: `git rebase branch_name`", "Type `git rebase main` into the terminal and press enter" ] } ] }, { "id": "950", "title": "fix conflicts", "summary": "", "content": "", "steps": [ { "id": "950.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "27eae18398d0bfca30fefb64c6a33d12bbec08f6" ] }, "content": "The conflict arose because the first commit you added to this branch changed the same lines as the commit from `main`. So it tried to add the commit, but couldn't because something was already there. There are sections, separated by characters (`<`, `>`, and `=`), that represent the commit you are on (`HEAD`) and the commit that is trying to be added (`feat: add column reference`). Fix the conflict by removing those `<`, `>`, and `=` characters. Then making the JSON object valid again.", "hints": [ "Be sure to remove all those special characters", "The part of the JSON object with conflicts should look like this:\n```json\n\"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\"\n},\n\"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\"\n },\n \"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "953", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "953.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "685c006e28d80b965808ff4e73ccc92140ff59cc" ] }, "content": "Check your status.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "956", "title": "git add fixed conflicts", "summary": "", "content": "", "steps": [ { "id": "956.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "ad35c9567bf173368ea112f7a7658673fe414dbd" ] }, "content": "It says that you are still in the middle of rebasing and there's one file that needs to be merged yet. Add the file to staging like you would any other commit.", "hints": [ "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "958", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "958.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "73973bf6c5c78d085b76a310d4f5ce78c2f4d0e8" ] }, "content": "Check your status again.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "960", "title": "git rebase continue", "summary": "", "content": "", "steps": [ { "id": "960.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "fb94e177d260a2965894855256b0541f671723ce" ] }, "content": "You fixed the conflicts that arose from trying to add this commit and added them to staging. It says `all conflicts fixed: run \"git rebase --continue\"`. Run the suggested command to continue the rebase.", "hints": [ "Enter `git rebase --continue` in the terminal and press enter" ] } ] }, { "id": "970", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "970.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "e9171afa79751cec8b095368be1dff9f08c5c192" ] }, "content": "The last commit was added after you continued the rebase without conflict. The rebase is now finished. View your log with the `oneline` flag.", "hints": [ "Use the `git log` command", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "980", "title": "Add RENAME COLUMN command", "summary": "", "content": "", "steps": [ { "id": "980.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "b1e80d3095ec69f0351f95f846d39021cbfda157" ] }, "content": "You can see the \"insert row\" commit from `main` was added to this branch before the two commits you made here. Now this branch is up to date and you can continue working on it. Add a `rename` key to the `column` object. The value should look like this: `\"ALTER TABLE table_name RENAME COLUMN column_name TO new_name;\"`", "hints": [ "The `column` key should look like this:\n```json\n\"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME COLUMN column_name TO new_name;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\"\n },\n \"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME COLUMN column_name TO new_name;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "990", "title": "git add RENAME COLUMN command", "summary": "", "content": "", "steps": [ { "id": "990.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "cd5e358f5a5dc356c658e3786e3e0c25078e9ca0" ] }, "content": "Check your status and diff to see your new changes. Then, add the file to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1000", "title": "git commit feat: add rename column reference", "summary": "", "content": "", "steps": [ { "id": "1000.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a70771366d23afc339eb22ac01de26a653f54e45" ] }, "content": "Commit your changes with the message `feat: add rename column reference`", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add rename column reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1010", "title": "git checkout feat/add-insert-row-reference", "summary": "", "content": "", "steps": [ { "id": "1010.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "5bab352dc949d3a0f7e98be87ea77029f34370f9" ] }, "content": "There's now three commits that are unique to this branch, you will come back to it later. Switch to the branch for adding row references.", "hints": [ "View your branches with `git branch` if you need to find the name", "Use the `git checkout` command to switch branches", "Here's an example: `git checkout branch_name`", "The branch you want is `feat/add-insert-row-reference`", "Enter `git checkout feat/add-insert-row-reference` into the terminal and press enter" ] } ] }, { "id": "1015", "title": "Add UPDATE ROW command", "summary": "", "content": "", "steps": [ { "id": "1015.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "7d05d812f48e7ece478363d4c80d20b2f506949d" ] }, "content": "This branch is still up to date since no commits have been added to `main` since this branch was created. Add an `update` key to the `row` object with `\"UPDATE table_name SET column_name = new_value WHERE condition;\"` as it's value.", "hints": [ "The `row` key should look like this:\n```json\n\"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "1017", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "1017.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "ae265dafb721a5c83758467086d0904396b08e8b" ] }, "content": "Check your status.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1020", "title": "git stash", "summary": "", "content": "", "steps": [ { "id": "1020.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "f7d866c0e58405c4120460d2027f61255342c555" ] }, "content": "There's been a mistake. This branch was for the `insert` command, not the `update` command. You can put your changes aside with `git stash`. Stash your changes so you can add them to a different branch.", "hints": [ "Type `git stash` in the terminal and press enter" ] } ] }, { "id": "1025", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "1025.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "28c15a87e2d51867f656fb0e32e9dc88795e0e96" ] }, "content": "You might have noticed your uncommitted changes disappeared from the file. Check your status again.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1030", "title": "git stash list", "summary": "", "content": "", "steps": [ { "id": "1030.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "b9ea9adb2bf67792c95f23fd025592158c77f66d" ] }, "content": "Your working tree is clean and there's no changes git recognizes. The changes you made are stashed. View the things you have stashed with `git stash list`.", "hints": [ "View your stash list with the suggested command", "Type `git stash list` in the terminal and press enter" ] } ] }, { "id": "1040", "title": "git stash pop", "summary": "", "content": "", "steps": [ { "id": "1040.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "bb92f65600500338fba12f62f8fb30abb8acb871" ] }, "content": "You can see one item there. Bring the changes back with `git stash pop`.", "hints": [ "Bring your stash back with the suggested command", "Type `git stash pop` in the terminal and press enter" ] } ] }, { "id": "1050", "title": "git stash list", "summary": "", "content": "", "steps": [ { "id": "1050.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a99edebbd37ef2c807d344b27a50f59708812faa" ] }, "content": "The changes from the stash reappeared in the file and git showed the status for you. You are right where you left of before stashing the changes. Popping a stash like that will remove the most recent stash and apply it to your working tree. View the list of your stashes again.", "hints": [ "Use the \"git stash list\" command in your repo", "Type `git stash list` in the terminal and press enter" ] } ] }, { "id": "1055", "title": "git stash", "summary": "", "content": "", "steps": [ { "id": "1055.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "19c04891a79a81aa2c70c5755cffc3c4bdab6a11" ] }, "content": "The list is empty again. Put the changes back in the stash.", "hints": [ "Use the \"git stash\" command", "Type `git stash` in the terminal and press enter" ] } ] }, { "id": "1070", "title": "git stash list", "summary": "", "content": "", "steps": [ { "id": "1070.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "1f8cfcdeeec2a61821ea0e9ced603e5465d0e30b" ] }, "content": "View the list of your stashed changes.", "hints": [ "Use the \"git stash list\" command in your repo", "Type `git stash list` in the terminal and press enter" ] } ] }, { "id": "1073", "title": "git stash show", "summary": "", "content": "", "steps": [ { "id": "1073.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "4a49375393647eea75884b4177c7fdc896061748" ] }, "content": "The changes are stashed again. View a condensed version of the changes in the **latest** stash with `git stash show`.", "hints": [ "Type `git stash show` in the terminal and press enter" ] } ] }, { "id": "1076", "title": "git stash show -p", "summary": "", "content": "", "steps": [ { "id": "1076.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "0a6d8a0db4248acdacee5376897150108a8c9879" ] }, "content": "You can see what file was changed and how many lines were added and removed from the file. View the full changes of the latest stash with `git stash show -p`. `-p` stands for \"patch\".", "hints": [ "Type `git stash show -p` in the terminal and press enter" ] } ] }, { "id": "1080", "title": "git stash apply", "summary": "", "content": "", "steps": [ { "id": "1080.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "b1a7c3c5cebee156566a1ddc58e254a485b0e8c8" ] }, "content": "Now you can see the actual changes that are stored in the stash. Before, you used the pop command to removed the latest stash and add it to your working tree. You can add the latest stash while keeping it in the list with `git stash apply`. Apply your stash with this method.", "hints": [ "Type `git stash apply` in the terminal and press enter" ] } ] }, { "id": "1090", "title": "git stash list", "summary": "", "content": "", "steps": [ { "id": "1090.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "f4591e82e393581d1027b8f27fee1ad70982d40e" ] }, "content": "Git showed you your status after applying the stash. The one file is unstaged again. View your stash list.", "hints": [ "Use the \"git stash list\" command in your repo", "Type `git stash list` in the terminal and press enter" ] } ] }, { "id": "1100", "title": "git stash", "summary": "", "content": "", "steps": [ { "id": "1100.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "bbe2570ed95579b242c24fb3f2d6dc4e8c8d9040" ] }, "content": "The code from the stash was added to your working tree, and the stash is still there in case you want to add it somewhere else. Stash the changes again.", "hints": [ "Use the \"git stash\" command", "Type `git stash` in the terminal and press enter" ] } ] }, { "id": "1110", "title": "git stash list", "summary": "", "content": "", "steps": [ { "id": "1110.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "56bcc51160cb1efc47ee83c0abc1c16494025772" ] }, "content": "View the list of your stashed changes again.", "hints": [ "Use the \"git stash list\" command in your repo", "Type `git stash list` in the terminal and press enter" ] } ] }, { "id": "1113", "title": "git stash show stash@{1}", "summary": "", "content": "", "steps": [ { "id": "1113.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "b3af86df8840e0cdadd38c89543532f6275aa301" ] }, "content": "Now there's two things stashed. You can use the name at the front of each stash (`stash@{#}`) with many of the stash commands to select one other than the latest one. The most recent stash is the one at the top, `stash@{0}`. View the condensed changes of the **oldest** stash with the `git stash show` command by putting the name of the stash after it.", "hints": [ "Add the stash name at the end of the `git stash show` command", "The stash name is `stash@{1}`", "Type `git stash show stash@{1}` in the terminal and press enter" ] } ] }, { "id": "1116", "title": "git stash show -p stash@{1}", "summary": "", "content": "", "steps": [ { "id": "1116.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "60f7caca3394802816489165f413e2f70ec47fc1" ] }, "content": "Next, using a similar method, **show** the full changes of the **oldest** stash with the \"patch\" flag you used earlier.", "hints": [ "The patch flag is `-p`", "Use the `git stash show` command with the patch flag", "Include the stash you want to view at the end of the command", "The stash you want to view is `stash@{1}`", "Type `git stash show -p stash@{1}` in the terminal and press enter" ] } ] }, { "id": "1120", "title": "git stash drop", "summary": "", "content": "", "steps": [ { "id": "1120.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "62464b374b5ae78554ee5def7c1a8dab276d0235" ] }, "content": "There's two identical items in your stash. Drop one of them with `git stash drop` or `git stash drop `.", "hints": [ "Drop one of the stashed changes with the suggested command", "Type `git stash drop` in the terminal and press enter" ] } ] }, { "id": "1130", "title": "git stash list", "summary": "", "content": "", "steps": [ { "id": "1130.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "e08da72ef80d6b0414897efac53bee5777608a00" ] }, "content": "View the list of stashed changes again to verify the one got deleted.", "hints": [ "Use the \"git stash list\" command in your repo", "Type `git stash list` in the terminal and press enter" ] } ] }, { "id": "1140", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "1140.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "5e19ad05c26e3eee3431f687e53821bad8fc9d9a" ] }, "content": "You should just have the one stash left. Switch to your `main` branch so you can create a new branch from that and add these changes to it.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "1150", "title": "git branch -d feat/add-insert-row-reference", "summary": "", "content": "", "steps": [ { "id": "1150.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "92f0994521a46dc4a16a4ad802ef12b7d56a3d4b" ] }, "content": "Before I make you work on the wrong branch again. Delete the branch for inserting a row.", "hints": [ "View your branches if you need to find the name", "Use the `git branch` command with the `-d` flag", "The branch name is `feat/add-insert-row-reference`", "Here's an example: `git branch -d branch_name`", "Type `git branch -d feat/add-insert-row-reference` into the terminal and press enter" ] } ] }, { "id": "1160", "title": "git checkout feat/add-more-row-references", "summary": "", "content": "", "steps": [ { "id": "1160.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "be65a8952a8dfa7e2880022a2db711eba8af7f05" ] }, "content": "Create and checkout a new branch named `feat/add-more-row-references` for adding some more row related commands.", "hints": [ "Use the \"git checkout\" command with the `-b` flag", "Here's an example: `git checkout -b branch_name`", "Type `git checkout -b feat/add-more-row-references` into the terminal and press enter" ] } ] }, { "id": "1170", "title": "git stash list", "summary": "", "content": "", "steps": [ { "id": "1170.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "058dcc24eeb4413358a4441de4a32c33953cbe84" ] }, "content": "Show me your stash list again to make sure your changes from the other branch are still stashed.", "hints": [ "Use the \"git stash list\" command in your repo", "Type `git stash list` in the terminal and press enter" ] } ] }, { "id": "1180", "title": "git stash pop", "summary": "", "content": "", "steps": [ { "id": "1180.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "af36f10684819caf0a4216df8a87a99b82bb5ff7" ] }, "content": "It's still there. Pop the stash so the code gets added to this new branch.", "hints": [ "Use the \"git stash pop\" command in your repo", "Type `git stash pop` in the terminal and press enter" ] } ] }, { "id": "1190", "title": "git stash list", "summary": "", "content": "", "steps": [ { "id": "1190.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "8193f3355936a018885c0e62b3258646ce45d29a" ] }, "content": "Git showed you your status again, and it looks like it recognizes that the file has new changes after adding the stash. View the stash list to verify that it's empty.", "hints": [ "Use the \"git stash list\" command in your repo", "Type `git stash list` in the terminal and press enter" ] } ] }, { "id": "1210", "title": "git diff", "summary": "", "content": "", "steps": [ { "id": "1210.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "0f220153d77c727552a78daa774e13a9ff6f4d35" ] }, "content": "The list is empty. View the diff of your changes so you can make sure they are what you expect.", "hints": [ "Use the \"git diff\" command", "Type `git diff` into the terminal and press enter", "Make sure you are in your repo folder first" ] } ] }, { "id": "1220", "title": "git add UPDATE ROW command", "summary": "", "content": "", "steps": [ { "id": "1220.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "f230eff567e7987e69eaf5e23a8f755cbf52b08b" ] }, "content": "It looks good. Add the changes to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1230", "title": "git commit feat: add update row reference", "summary": "", "content": "", "steps": [ { "id": "1230.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "d5680c2f9f0b2c2d6c312bb2336114a90f105adb" ] }, "content": "View your status, then commit the staged changes with the message `feat: add update row reference`.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add update row reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1240", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "1240.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a908131ccd54b4546c7e870ae271d5f4275108b6" ] }, "content": "Your work on this branch is done for now. Switch to your `main` branch so you can merge the commit you just made.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "1250", "title": "git merge feat/add-more-row-references", "summary": "", "content": "", "steps": [ { "id": "1250.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "99565f4f72fa27481481e7b910d4ee36135adfe0" ] }, "content": "Merge your branch for adding row references that you just added a commit to.", "hints": [ "Use the \"git merge\" command", "View your branches if you need to find the name", "It's the `feat/add-more-row-references` branch", "Here's an example: `git merge branch_name`", "Type `git merge feat/add-more-row-references` into the terminal and press enter" ] } ] }, { "id": "1260", "title": "git checkout feat/add-column-references", "summary": "", "content": "", "steps": [ { "id": "1260.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "d122d65035f157d66841ccba80aca4cfa1c50316" ] }, "content": "Switch to your branch for the column references so you can continue working on that.", "hints": [ "Use the `git checkout` command", "View your branches if you need to find the name", "Here's an example: `git checkout branch_name`", "Enter `git checkout feat/add-column-references` into the terminal and press enter" ] } ] }, { "id": "1270", "title": "git rebase main", "summary": "", "content": "", "steps": [ { "id": "1270.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "8623eb7e0047943839d3eb4a0fcd794aa6dfe761" ] }, "content": "Once again, commits have been added to `main` so you should update this branch. Rebase this branch against `main` to bring in the new commits. You should get a conflict.", "hints": [ "Use the \"git rebase\" command", "Add the branch after the command that you want to rebase against", "Here's an example: `git rebase branch_name`", "Type `git rebase main` into the terminal and press enter" ] } ] }, { "id": "1280", "title": "Fix Conflicts", "summary": "", "content": "", "steps": [ { "id": "1280.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "10c8a4a7512d844d18b855fe34f50f33d02959ab" ] }, "content": "This conflict is a little trickier. Make the JSON object whole again so you can add the changes and finish rebasing. Make sure you put all the references in their correct objects, and in the same order they were originally in. There may be a duplicate line you need to delete.", "hints": [ "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\"\n },\n \"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "1290", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "1290.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "391d7e5889b090a5ff7007823a18b32612f9f657" ] }, "content": "View the status of your repo.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1300", "title": "git add fixed conflicts", "summary": "", "content": "", "steps": [ { "id": "1300.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "840e75ad15333cc304b8a36b9c21c1265f8aa9f0" ] }, "content": "You are still rebasing. You fixed the conflicts for the commit trying to be added. It looks like it was the \"add column\" commit that had the conflict. Add your changes to staging.", "hints": [ "Use the \"git add\" command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1305", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "1305.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "fe0d5742ea53422ab2b668c03c258411ab4a7a10" ] }, "content": "View the status again.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1310", "title": "git rebase continue", "summary": "", "content": "", "steps": [ { "id": "1310.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "7ce3b5e9cc2fb32ee76dc0310c2246bff4694df5" ] }, "content": "Continue your rebase with the suggested command.", "hints": [ "View the output in the terminal to find the command", "It's the \"git rebase continue\" command", "Enter `git rebase --continue` in the terminal and press enter" ] } ] }, { "id": "1320", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "1320.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "1d04afb723f91cd49d2678b6261215120a227ec8" ] }, "content": "The rest of the commits were added without conflict. View your log with the oneline flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "1330", "title": "Add PRIMARY KEY command", "summary": "", "content": "", "steps": [ { "id": "1330.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "b78f2c0cc0a0471bb9976b01eacdb6819dfb12b5" ] }, "content": "The rebase added the \"row\" commits where they are supposed to be, then the \"column\" commits from this branch on top. Excellent. Now you can continue working on it. Add a reference to the column object for setting a column as the primary key. Give it a key of `primary_key` and a value of `\"ALTER TABLE table_name ADD PRIMARY KEY(column_name);\"`", "hints": [ "The `column` key should look like this:\n```json\n\"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME COLUMN column_name TO new_name;\",\n \"primary_key\": \"ALTER TABLE table_name ADD PRIMARY KEY(column_name);\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\"\n },\n \"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME COLUMN column_name TO new_name;\",\n \"primary_key\": \"ALTER TABLE table_name ADD PRIMARY KEY(column_name);\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "1340", "title": "git diff PRIMARY KEY command", "summary": "", "content": "", "steps": [ { "id": "1340.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "f8c751e1f910f61ca692695d164a79539440c1e5" ] }, "content": "Check the diff to make sure you like your changes. Then, add the changes to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1350", "title": "git commit feat: add primary key reference", "summary": "", "content": "", "steps": [ { "id": "1350.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "d72bad7889a1decf037d2ba9b0925a5bf0a2db68" ] }, "content": "Commit your staged files with `feat: add primary key reference` as the message.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add primary key reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1352", "title": "Add FOREIGN KEY command", "summary": "", "content": "", "steps": [ { "id": "1352.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "a62fff6f73dea14ea423be2ac459aceb6acbbe7f" ] }, "content": "Add `foreign_key` to the `column` object for another command. It's value should be `\"ALTER TABLE table_name ADD FOREIGN KEY(column_name) REFERENCES table_name(column_name);\"`.", "hints": [ "The `column` key should look like this:\n```json\n\"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME COLUMN column_name TO new_name;\",\n \"primary_key\": \"ALTER TABLE table_name ADD PRIMARY KEY(column_name);\",\n \"foreign_key\": \"ALTER TABLE table_name ADD FOREIGN KEY(column_name) REFERENCES table_name(column_name);\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\"\n },\n \"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME COLUMN column_name TO new_name;\",\n \"primary_key\": \"ALTER TABLE table_name ADD PRIMARY KEY(column_name);\",\n \"foreign_key\": \"ALTER TABLE table_name ADD FOREIGN KEY(column_name) REFERENCES table_name(column_name);\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "1354", "title": "git add FOREIGN command", "summary": "", "content": "", "steps": [ { "id": "1354.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "97b9a7326a85ec8df69c627bbce08c918c5f7193" ] }, "content": "Check the diff to make sure you like the changes, then add the changes to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1356", "title": "git commit feat: add foreign key reference", "summary": "", "content": "", "steps": [ { "id": "1356.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "4de8f1922e631042b63dad664f804777df644b46" ] }, "content": "Commit the changes with `feat: add foreign key reference` as its message.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add foreign key reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1360", "title": "git checkout feat/add-more-row-references", "summary": "", "content": "", "steps": [ { "id": "1360.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "c10bd03ed501ba829bf28957370a78444b73043e" ] }, "content": "Go to your branch for the row references so you can continue work on those.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Use the `git branch` command to find the name of the branch", "It's the `feat/add-more-row-references` branch", "Enter `git checkout feat/add-more-row-references` into the terminal and press enter" ] } ] }, { "id": "1370", "title": "Add DELETE ROW command", "summary": "", "content": "", "steps": [ { "id": "1370.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "eb459fc77196f28c3b77893000a05f9f0ac02105" ] }, "content": "In your JSON file, add a `delete` key to the `row` object. Take a guess at the value, it should include the `DELETE FROM` and `WHERE` keywords. The whole value is in the hints.", "hints": [ "The `row.delete` value should be `\"DELETE FROM table_name WHERE condition;\"`", "The `row` key should look like this:\n```json\n\"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\",\n \"delete\": \"DELETE FROM table_name WHERE condition;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\",\n \"delete\": \"DELETE FROM table_name WHERE condition;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "1380", "title": "git add DELETE ROW command", "summary": "", "content": "", "steps": [ { "id": "1380.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "090c81ab167ec0227465a6e1874db4f4c716252d" ] }, "content": "View the diff of your changes, then add them to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1390", "title": "git commit feat: add delete row reference", "summary": "", "content": "", "steps": [ { "id": "1390.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "44543aa53022598f6952197cc0723c8cc6c8b3b2" ] }, "content": "Commit the staged changes with the message `feat: add delete row reference`.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add delete row reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1400", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "1400.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "2ef7d9bf799113e8dc6f42793e814ec3659f146c" ] }, "content": "Go to the `main` branch so you can merge these commits.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "1410", "title": "git merge feat/add-more-row-references", "summary": "", "content": "", "steps": [ { "id": "1410.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "7ddc879248298c082d78e42cd2cb241a13448940" ] }, "content": "Merge the branch for the row commands into `main`.", "hints": [ "Use the \"git merge\" command", "Here's an example: `git merge branch_name`", "Use the `git branch` command if you need to find the branch name", "It's the `feat/add-more-row-references` branch", "Type `git merge feat/add-more-row-references` into the terminal and press enter" ] } ] }, { "id": "1416", "title": "git branch -d feat/add-more-row-references", "summary": "", "content": "", "steps": [ { "id": "1416.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "576afa9bd2c4ef8b1793d850ff1f485bbd4b902d" ] }, "content": "You merged the branch and are done with it. Delete the branch for the row references.", "hints": [ "Use the `git branch` command with the `-d` flag", "Here's an example: `git branch -d branch_name`", "View your branches if you need to find the name", "The branch name is `feat/add-more-row-references`", "Type `git branch -d feat/add-more-row-references` into the terminal and press enter" ] } ] }, { "id": "1420", "title": "git checkout -b fix/add-missing-rename-references", "summary": "", "content": "", "steps": [ { "id": "1420.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "f53976b672da28924f1245ea887ac9d877228583" ] }, "content": "I missed a bunch of the rename commands when I had you work on a few of the objects. Create and checkout a branch named `fix/add-missing-rename-references`.", "hints": [ "Use the `git checkout` command with the `-b` flag", "Here's an example: `git checkout -b branch_name`", "Type `git checkout -b fix/add-missing-rename-references` into the terminal and press enter" ] } ] }, { "id": "1430", "title": "Add RENAME DATABASE command", "summary": "", "content": "", "steps": [ { "id": "1430.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "f9169031930f6d75156c7cb55b2bed923c11398b" ] }, "content": "I forgot to add a command for how to rename a database. In your JSON file, add a `rename` key to the `database` object. The value should be `\"ALTER DATABASE database_name RENAME TO new_name;\"`", "hints": [ "The `database` object should look like this:\n```json\n\"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\",\n \"rename\": \"ALTER DATABASE database_name RENAME TO new_name;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\",\n \"rename\": \"ALTER DATABASE database_name RENAME TO new_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\",\n \"delete\": \"DELETE FROM table_name WHERE condition;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "1440", "title": "git add RENAME DATABASE command", "summary": "", "content": "", "steps": [ { "id": "1440.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "cc0eef92872093de2504133aaa559e25b6088593" ] }, "content": "View the diff of your changes to make sure you like them, then add them to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1450", "title": "git commit fix: add missing rename database reference", "summary": "", "content": "", "steps": [ { "id": "1450.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "f428927667282945502e558b7c48cb8e972683f8" ] }, "content": "Commit your stages changes with `fix: add missing rename database reference` for the message.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"fix: add missing rename database reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1460", "title": "git checkout feat/add-column-references", "summary": "", "content": "", "steps": [ { "id": "1460.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "84be7d80e2ab3f5336d40ac9cdaf580f831694ff" ] }, "content": "Leave this branch for now. Switch back to your branch for the column references so you can hopefully finally finish it.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Use the `git branch` command to find the name of the branch", "It's the `feat/add-column-references` branch", "Enter `git checkout feat/add-column-references` into the terminal and press enter" ] } ] }, { "id": "1470", "title": "git rebase main", "summary": "", "content": "", "steps": [ { "id": "1470.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "23068515b7f36d7db10d5e524e6a01308524e92d" ] }, "content": "There was a commit to `main` since you last worked on this from when you merged the \"add more row references\" branch. Rebase this branch against `main` so it's up to date and you can finish working on it.", "hints": [ "Use the \"git rebase\" command", "Add the branch after the command that you want to rebase against", "Here's an example: `git rebase branch_name`", "Type `git rebase main` into the terminal and press enter" ] } ] }, { "id": "1480", "title": "Fix Conflicts", "summary": "", "content": "", "steps": [ { "id": "1480.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "1e333784436aee6c1a3a6d4682e1ed9956b91e36" ] }, "content": "Fix the conflicts so that all the commands are in their correct objects.", "hints": [ "Be sure to delete any special characters", "The order of the keys should be:\n```json\n{\n \"database\": {},\n \"table\": {},\n \"row\": {},\n \"column\": {}\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\",\n \"delete\": \"DELETE FROM table_name WHERE condition;\"\n },\n \"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "1490", "title": "git add Fixed Conflicts", "summary": "", "content": "", "steps": [ { "id": "1490.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "03270b33ed1e2526f7ea91bb3d6fb7c1ce5d57f8" ] }, "content": "You fixed the conflicts. Check your status, then add your files to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1495", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "1495.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "45803dbca4b4aa9ed52efe8a7cc9de620ed99edf" ] }, "content": "Check your status again.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1500", "title": "git rebase continue", "summary": "", "content": "", "steps": [ { "id": "1500.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "ed9b7d33f78f82bf3f1d74d6643761c7cdaad504" ] }, "content": "Use the suggested command to continue your rebase.", "hints": [ "View the output in the terminal to find the command", "It's the \"git rebase continue\" command", "Enter `git rebase --continue` in the terminal and press enter" ] } ] }, { "id": "1510", "title": "Add UNIQUE command", "summary": "", "content": "", "steps": [ { "id": "1510.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "831c9cf8d9c92e0ae51438670ace493bbfb79222" ] }, "content": "There was a conflict when it tried to add the first commit from this branch on top of the one that was brought in from `main`. The rest of the commits were added without conflicts. In your JSON file, add a `unique` key to the `column` object. Give it a value of `\"ALTER TABLE table_name ADD UNIQUE(column_name);\"`", "hints": [ "The should be `\"unique\": \"ALTER TABLE table_name ADD UNIQUE(column_name);\"` in your `column` object", "The `column` object should look like this:\n```json\n\"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME COLUMN column_name TO new_name;\",\n \"primary_key\": \"ALTER TABLE table_name ADD PRIMARY KEY(column_name);\",\n \"foreign_key\": \"ALTER TABLE table_name ADD FOREIGN KEY(column_name) REFERENCES table_name(column_name);\",\n \"unique\": \"ALTER TABLE table_name ADD UNIQUE(column_name);\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\",\n \"delete\": \"DELETE FROM table_name WHERE condition;\"\n },\n \"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME COLUMN column_name TO new_name;\",\n \"primary_key\": \"ALTER TABLE table_name ADD PRIMARY KEY(column_name);\",\n \"foreign_key\": \"ALTER TABLE table_name ADD FOREIGN KEY(column_name) REFERENCES table_name(column_name);\",\n \"unique\": \"ALTER TABLE table_name ADD UNIQUE(column_name);\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "1520", "title": "git add UNIQUE command", "summary": "", "content": "", "steps": [ { "id": "1520.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "08986aa8786c53d5cd2af60571238279ecf70552" ] }, "content": "View the diff to make sure you like the changes, then add the changes to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1530", "title": "git commit feat: add unique reference", "summary": "", "content": "", "steps": [ { "id": "1530.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "3a036672632fedf13408c6d50490d0e9020d3bb1" ] }, "content": "Commit the stages files with `feat: add unique reference` for the message.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add unique reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1533", "title": "git reset HEAD~1", "summary": "", "content": "", "steps": [ { "id": "1533.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "113b35af5518588cba0071754498dbb8f5919a19" ] }, "content": "I'm going to show you a few ways to remove or undo a commit. The first is to simply \"travel back in time\". You can use the `git reset` command to travel to any point in your commit history. Your current `HEAD` is a reference to the last commit you just made. Use `git reset HEAD~1` to go back one before `HEAD`.", "hints": [ "Enter `git reset HEAD~1` in the terminal" ] } ] }, { "id": "1536", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "1536.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "f831207e256dfb9003504afbcc4eb3c57f93373b" ] }, "content": "This is a \"mixed\" reset and will put the changes from the commit you undid in your working tree. You can see that it says there's unstaged changes after the reset to your file. View your log with the oneline flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "1539", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "1539.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a337df5a9d21a1e9ed7c3f492c82ca659369d85f" ] }, "content": "Your commit for how to set a column to unique is gone. View your status.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1540", "title": "git diff", "summary": "", "content": "", "steps": [ { "id": "1540.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "22af41124e862e7db9a6a5044001287bda7cbab4" ] }, "content": "View the diff.", "hints": [ "Use the \"git diff\" command", "Type `git diff` into the terminal and press enter" ] } ] }, { "id": "1542", "title": "git add UNIQUE command", "summary": "", "content": "", "steps": [ { "id": "1542.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "2b3a36b72ca14dfb8755b2725ebca0f03b2850e7" ] }, "content": "And the changes from the reset are back in the working tree. So when you `reset` to one commit before `HEAD`, it removed the most recent commit, and put all the changes in the working tree. If you used the `--hard` flag with the reset, the changes would have not been added to the working tree and if you used the `--soft` flag, the changes would have been added to the working tree and to staging. Add the changes back to staging so you can commit them again.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1545", "title": "git commit feat: add unique reference", "summary": "", "content": "", "steps": [ { "id": "1545.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "0aea00f892344c7829190e10cf65e10651c02c00" ] }, "content": "Commit the change staged files with `feat: add unique reference` for its message.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add unique reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1548", "title": "git revert HEAD", "summary": "", "content": "", "steps": [ { "id": "1548.1", "setup": { "watchers": [ "./.freeCodeCamp/test/.next_command" ], "commits": [ "37bb15256963cc6b88931ebd46ea014a5b9482dd" ] }, "content": "Reverting is a good way to undo a commit because you don't lose the commit from the history. You can revert the most recent commit (`HEAD`) with `git revert HEAD`. Do that now.", "hints": [ "Enter the suggested command", "Enter `git revert HEAD` in the terminal" ] } ] }, { "id": "1549", "title": "Nano: Enter git revert HEAD Message", "summary": "", "content": "", "steps": [ { "id": "1549.1", "setup": { "watchers": [ "./.freeCodeCamp/test/.next_command" ], "commits": [ "f8b195d63603b7c6c7ed9d8cd0d3318f1978eeb9" ] }, "content": "Git put you into Nano and is asking you enter a commit message for the revert, but they added a default one for you. Don't change anything in Nano, just exit the file to use the default message. You can exit the file by pressing `ctrl+x`.", "hints": [ "Exit the file by pressing `ctrl+x`", "If you accidentally changed something in Nano, press `n` after `ctrl+x` to discard the changes", "Your last commit message should be `Revert \"feat: add unique reference\"`", "View your log to make sure the message is correct", "To reset this lesson, make sure nano is closed. Then, hit reset and enter `git revert HEAD` after it's done resetting" ] } ] }, { "id": "1551", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "1551.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "4b89e88c8bb380d4a92dafb5668088a51455deb3" ] }, "content": "View the log with that flag I like again.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter", "Press enter until you have seen the whole log" ] } ] }, { "id": "1554", "title": "git show", "summary": "", "content": "", "steps": [ { "id": "1554.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "da63956dc6bc8ee0404ef6786d9deb235c846d21" ] }, "content": "Using revert to undo that commit added another commit that is the exact opposite of it. Enter `git show` into the terminal to see the last commit added (now `HEAD`) and its details.", "hints": [ "Enter the suggested command", "Type `git show` in the terminal and press enter", "Press enter until you have seen the whole message" ] } ] }, { "id": "1557", "title": "git show HEAD~1", "summary": "", "content": "", "steps": [ { "id": "1557.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "5fae53675164d8a7a2128d39ba6d8b87c098de29" ] }, "content": "Type `git show HEAD~1` to take a look at the details of the original commit that you reverted.", "hints": [ "Enter the suggested command", "Type `git show` in the terminal and press enter" ] } ] }, { "id": "1560", "title": "git rebase interactive HEAD~2", "summary": "", "content": "", "steps": [ { "id": "1560.1", "setup": { "watchers": [ "./.freeCodeCamp/test/.next_command" ], "commits": [ "08ef5d2f3d0414dfcb5167297e49a2e017236599" ] }, "content": "If you look at the bottom of those two messages, it shows the diff. The diff of the revert commit is the exact opposite of the one before it. Effectively, undoing the changes. You've used rebase to update this branch, but you can enter an \"interactive\" mode to manipulate commits. Type `git rebase --interactive HEAD~2` into the terminal to enter this mode. The `HEAD~2` means you will have a chance to change the last two commits.", "hints": [ "Enter the suggested command", "Type `git rebase --interactive HEAD~2` into the terminal and press enter", "If you entered the wrong command, save and exit Nano. Then try again", "You can save and exit Nano by pressing `ctrl+x` then `y` then `enter`" ] } ] }, { "id": "1563", "title": "Nano: Drop UNIQUE commits", "summary": "", "content": "", "steps": [ { "id": "1563.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "d81bc2de6857cfc71b96bf77989c56561d78ce92" ] }, "content": "At the top of Nano, you can see the two commits with `pick` next to them. Below them, there's a list of options for working with them. `pick` means that it will use the commits as they were. At the bottom, it says, `d, drop = remove commit`. Replace the word `pick` preceeding your two commits with a `d` to drop them both. When you are done, save the file and exit Nano.", "hints": [ "You can save and exit Nano by pressing `ctrl+x` then `y` then `enter`", "The most recent commit message should be `feat: add foreign key reference`", "To reset this lesson, make sure nano is closed. Then, hit reset and enter `git rebase --interactive HEAD~2` after it's done resetting" ] } ] }, { "id": "1564", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "1564.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "0ef24c5b75a2a518912625fb214c779890123692" ] }, "content": "View your log. Use the `--oneline` flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter", "Press enter until you have seen the whole history" ] } ] }, { "id": "1567", "title": "git rebase interactive root", "summary": "", "content": "", "steps": [ { "id": "1567.1", "setup": { "watchers": [ "./.freeCodeCamp/test/.next_command" ], "commits": [ "45ed437875b79d75a1fb63e3e87e6f729ffa6517" ] }, "content": "Both, the commit to add the unique command and the one to revert it, were dropped. Enter another `--interactive` rebase that goes back to the `--root` instead of `HEAD~2`. I am going to show you how to change a commit message. `--root` means that the rebase will go back to your very first commit.", "hints": [ "The command is `git rebase` with two arguments", "The two arguments are `--interactive` and `--root`", "Enter `git rebase --interactive --root` into the terminal and press enter" ] } ] }, { "id": "1570", "title": "Nano: Select Reword Column References Commit", "summary": "", "content": "", "steps": [ { "id": "1570.1", "setup": { "watchers": [ "./sql_reference/.git/rebase-merge/done" ], "commits": [ "3c359cb186e34439692b3aca53469cf3ac3de1f8" ] }, "content": "You can see that the latest commit is at the bottom here. Be careful not to change the wrong commits. One of the options is `r, reword = use commit, but edit the commit message`. Replace `pick` with an `r` next to the commit with the message `feat: add column reference` to reword the message, it's the very first commit you added to this branch. When you are done, save the file and exit Nano. Git will put you in another Nano instance to reword the commit message. Don't change anything in it yet.", "hints": [ "Replace `pick` with an `r` next to the suggested commit", "Save and exit the file by pressing `ctrl+x` then `y` then `enter`", "To reset this lesson, make sure nano is closed. Then, hit reset and enter `git rebase --interactive --root` after it's done resetting" ] } ] }, { "id": "1572", "title": "Nano: Change Column References Commit Message", "summary": "", "content": "", "steps": [ { "id": "1572.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "9b7cb375455143f2afc03083bb8f8eaca8d9bb07" ] }, "content": "Git is waiting for you to edit the commit message. Add an `s` at the end of the commit message so it is `feat: add column references`. When you are done, save the file and exit Nano.", "hints": [ "Save and exit the file by pressing `ctrl+x` then `y` then `enter`", "To reset this lesson, make sure nano is closed. Then, hit reset and enter `git rebase --interactive --root` after it's done resetting. Then, in nano, replace `pick` with an `r` next to the `feat: add column reference` commit, and save and exit" ] } ] }, { "id": "1575", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "1575.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "68f6eb7ff87f55ecce2a5ec4cb1ca3f428bbc8b7" ] }, "content": "View your log. Use the `--oneline` flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter", "Press enter until you have seen the whole history" ] } ] }, { "id": "1576", "title": "git rebase main", "summary": "", "content": "", "steps": [ { "id": "1576.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a899bbb8478cc13dd663c1d20d340d0405c2585c" ] }, "content": "The message was reworded, but there's a problem. Look at the commit hash for your `Initial commit` from the last two times you viewed the log, it's that string left of the log. They aren't the same anymore since you rebased back to the root. Same goes for the rest of the commits. When you rebase interactively it changes all those hashes, so git sees them as different commits. If you were to try and merge this into `main`, it wouldn't work because they don't share the same history anymore. For this reason, you don't want to do an interactive rebase where you go back passed commits unique to the branch you are on. Fortunately, you can fix this. Enter `git rebase main` to realign the history of the two branches.", "hints": [ "Use the \"git rebase\" command", "Add the branch after the command that you want to rebase against", "Here's an example: `git rebase branch_name`", "Type `git rebase main` into the terminal and press enter" ] } ] }, { "id": "1578", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "1578.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "4a377f565395df3b6dc27f49b9e7b43d46fcb6cd" ] }, "content": "View your log again. Use the `--oneline` flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "1580", "title": "git rebase interactive HEAD~5", "summary": "", "content": "", "steps": [ { "id": "1580.1", "setup": { "watchers": [ "./.freeCodeCamp/test/.next_command" ], "commits": [ "45e0a3ddd4f5efddd5e47175978152f8d621c559" ] }, "content": "Now the hashes are the same as they were before you rebased back to `--root`, which is what they are on `main`. Enter another interactive rebase. Go back to the first commit you added to this branch, it's `HEAD~5`.", "hints": [ "It's the `git rebase` command with two arguments", "The two arguments are `--interactive` and `HEAD~5`", "Enter `git rebase --interactive HEAD~5` into the terminal and press enter", "If you entered the wrong command, exit nano without changing anything. Then try again.", "You can exit nano by pressing `ctrl+x`", "If you accidentally changed something in Nano, press `n` after `ctrl+x` to discard the changes" ] } ] }, { "id": "1590", "title": "Nano: Squash feat/add-column-references Commits", "summary": "", "content": "", "steps": [ { "id": "1590.1", "setup": { "watchers": [ "./sql_reference/.git/rebase-merge/done" ], "commits": [ "8b8da46365a13d1597ceddf887b6e7afd731dbad" ] }, "content": "Squashing commits means that you will take a bunch of commits and turn them into one. This is helpful to keep your commit history clean and something you want try to do. Replace `pick` with an `s` next to all your commits except the one with the message `feat: add column references`. When you are done, save and exit the file. You will find yourself in another instance of Nano. Don't change anything in it yet.", "hints": [ "Replace `pick` with an `s` next to the suggested commits", "Save and exit the file by pressing `ctrl+x` then `y` then `enter`", "The most recent commit message should be `feat: add column references`", "To reset this lesson, make sure nano is closed. Then, hit reset and enter `git rebase --interactive HEAD~5` after it's done resetting" ] } ] }, { "id": "1595", "title": "Nano: Save and Exit to Squash", "summary": "", "content": "", "steps": [ { "id": "1595.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "fce6fe8900ba56d04447a0cecd9e5293e87da943" ] }, "content": "Nano brought up a list of all the commit messages you used for the commits. Don't change anything in there, just exit the file to use those messages and finish squashing the commits.", "hints": [ "Press `ctrl+x` to exit the file", "To reset this lesson, make sure nano is closed. Then, hit reset and enter `git rebase --interactive HEAD~5` after it's done resetting. Then, in nano, replace `pick` with an `s` next to all the commits except the `feat: add column reference` commit, and save and exit" ] } ] }, { "id": "1600", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "1600.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "0fe693e671cc7a6b03aecf84c0bfcfb4694e80dd" ] }, "content": "View your log with the oneline flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "1610", "title": "git log -1", "summary": "", "content": "", "steps": [ { "id": "1610.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "c6958a7373ce91ad7b956a7690a41c9682427501" ] }, "content": "Now all the \"column\" commits you made to this branch have been squashed into just the one commit at the top. View the log again, but use `-1` instead of `--oneline` this time to view only the last commit.", "hints": [ "Use `git log` with the suggested argument", "Type `git log -1` into the terminal and press enter" ] } ] }, { "id": "1620", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "1620.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "917207048c234b2bea047ae8cbd7c3b94334a9d8" ] }, "content": "You can see that your one commit has all the messages that were in Nano, which are all of the commits you made to this branch squashed into one commit. I think you are finally done with this branch. Go to your `main` branch so it can get merged.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "1630", "title": "git merge feat/add-column-references", "summary": "", "content": "", "steps": [ { "id": "1630.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "68a83e9dcd9da9ba0b623ac6b84976c3940f7986" ] }, "content": "Merge your branch for adding column commands into this one.", "hints": [ "Use the `git merge` command with the branch name after it", "Here's an example: `git merge branch_name`", "Use the `git branch` command if you need to find the branch name", "It's the `feat/add-column-references` branch", "Type `git merge feat/add-column-references` into the terminal and press enter", "If you got `fatal: refusing to merge unrelated histories`, you need to switch back to the feature branch, enter `git rebase main` to align the histories, then come back to `main` and try again" ] } ] }, { "id": "1635", "title": "git branch -d feat/add-column-references", "summary": "", "content": "", "steps": [ { "id": "1635.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "42b1d3339bcb2c0ec27e56b64fa0a207cd9385c7" ] }, "content": "Hopefully, there were no conflicts. Delete your branch for adding information about column commands since you are done with it.", "hints": [ "Use the `git branch` command with the `-d` flag", "Here's an example: `git branch -d branch_name`", "View your branches if you need to find the name", "The branch name is `feat/add-column-references`", "Type `git branch -d feat/add-column-references` into the terminal and press enter" ] } ] }, { "id": "1640", "title": "git checkout fix/add-missing-rename-references", "summary": "", "content": "", "steps": [ { "id": "1640.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "5d44ff1a6bae4b330cbe67c24362e5b51ac4330f" ] }, "content": "Go to your branch for adding the commands that were missing. There's one more to add.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Use the `git branch` command to find the name of the branch", "It's the `fix/add-missing-rename-references` branch", "Enter `git checkout fix/add-missing-rename-references` into the terminal and press enter" ] } ] }, { "id": "1650", "title": "git rebase main", "summary": "", "content": "", "steps": [ { "id": "1650.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "5c084993a86bbae2b8241b1a53d9b0520e9ea6c0" ] }, "content": "There was added a commit to `main` since you last worked on this. Update this branch with a rebase against main.", "hints": [ "Use the \"git rebase\" command", "Add the branch after the command that you want to rebase against", "Here's an example: `git rebase branch_name`", "Type `git rebase main` into the terminal and press enter" ] } ] }, { "id": "1680", "title": "git log -5 oneline", "summary": "", "content": "", "steps": [ { "id": "1680.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a36cbec32ae69744bc5342fbeca6460debab5425" ] }, "content": "You viewed the most recent log with a `-1` flag. You can view the last `x` number of commits with any number instead of `1`. View the last five commits with the oneline flag.", "hints": [ "Use the `git log` command with the correct two arguments", "The two arguments are `-5` and `--oneline`", "Type `git log -5 --oneline` into the terminal and press enter" ] } ] }, { "id": "1690", "title": "Add RENAME TABLE Command", "summary": "", "content": "", "steps": [ { "id": "1690.1", "setup": { "watchers": [ "./sql_reference/sql_reference.json" ], "commits": [ "6ddad8297e4141f0aaa90fd4eea0ad3a1694cd86" ] }, "content": "This branch is up to date now. In your JSON file, add a `rename` key to the `table` object. The value is in the hints, but give it a try first. It follows a similar structure as the rest of them.", "hints": [ "The value is `\"ALTER TABLE table_name RENAME TO new_name;\"`", "The `table` object should look like this:\n```json\n{\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME TO new_name;\"\n}\n```", "The whole file should look like this:\n```json\n{\n \"database\": {\n \"create\": \"CREATE DATABASE database_name;\",\n \"drop\": \"DROP DATABASE database_name;\",\n \"rename\": \"ALTER DATABASE database_name RENAME TO new_name;\"\n },\n \"table\": {\n \"create\": \"CREATE TABLE table_name();\",\n \"drop\": \"DROP TABLE table_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME TO new_name;\"\n },\n \"row\": {\n \"insert\": \"INSERT INTO table_name(columns) VALUES(values);\",\n \"update\": \"UPDATE table_name SET column_name = new_value WHERE condition;\",\n \"delete\": \"DELETE FROM table_name WHERE condition;\"\n },\n \"column\": {\n \"add\": \"ALTER TABLE table_name ADD COLUMN column_name;\",\n \"drop\": \"ALTER TABLE table_name DROP COLUMN column_name;\",\n \"rename\": \"ALTER TABLE table_name RENAME COLUMN column_name TO new_name;\",\n \"primary_key\": \"ALTER TABLE table_name ADD PRIMARY KEY(column_name);\",\n \"foreign_key\": \"ALTER TABLE table_name ADD FOREIGN KEY(column_name) REFERENCES table_name(column_name);\"\n }\n}\n\n```", "Make sure there's one empty line at the bottom of the file and no extra spaces after any of the values or curly brackets", "You can view the `git diff` to see if there's any extra spaces" ] } ] }, { "id": "1700", "title": "git add RENAME TABLE command", "summary": "", "content": "", "steps": [ { "id": "1700.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "aa2341028298d41f167d55a11513b3d93fd0f79a" ] }, "content": "Check the diff of your changes, then add them changes to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add README.md` to add changes to staging", "Type `git add sql_reference.json` into the terminal and press enter" ] } ] }, { "id": "1710", "title": "git commit fix: add missing rename table reference", "summary": "", "content": "", "steps": [ { "id": "1710.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "c6f586cd93d00c87e1e32e611621ea39f01ead04" ] }, "content": "Commit your staged changes with the message, `fix: add missing rename table reference`.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"fix: add missing rename table reference\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1715", "title": "git log -5 oneline", "summary": "", "content": "", "steps": [ { "id": "1715.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "31969873a25dc987f4c857bfbd65ed0ec3d231b5" ] }, "content": "View your last five logs with the oneline flag again.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Use `-5` with your `git log --oneline` command", "Type `git log --oneline -5` into the terminal and press enter" ] } ] }, { "id": "1720", "title": "git rebase interactive HEAD~2", "summary": "", "content": "", "steps": [ { "id": "1720.1", "setup": { "watchers": [ "./.freeCodeCamp/test/.next_command" ], "commits": [ "72e83a79479e184999719a44fc7eaba9c83757fb" ] }, "content": "You have two commits on this branch that could be squashed. Enter an interactive rebase that goes back to `HEAD~2` so you can squash them.", "hints": [ "It's the `git rebase` command with two arguments", "The two arguments and `--interactive` and `HEAD~2`", "Enter `git rebase --interactive HEAD~2` into the terminal and press enter", "If you entered the wrong command, save and exit nano without changing anything. Then try again", "You can save and exit nano by pressing `ctrl+x` then `y` then `enter`" ] } ] }, { "id": "1730", "title": "Nano: Squash feat/add-missing-rename-references Commits", "summary": "", "content": "", "steps": [ { "id": "1730.1", "setup": { "watchers": [ "./sql_reference/.git/rebase-merge/done" ], "commits": [ "fad89242f8e7ae108e38fa321f0f5d4106301789" ] }, "content": "Replace `pick` with `s` next to your commit for adding the rename table reference to squash it. Be careful not to do the wrong one. When you are done, save and exit Nano.", "hints": [ "Replace `pick` with `s` next to your `fix: add missing rename table reference` commit", "You can save and exit nano by pressing `ctrl+x` then `y` then `enter`", "To reset this lesson, make sure nano is closed. Then, hit reset and enter `git rebase --interactive HEAD~2` after it's done resetting" ] } ] }, { "id": "1735", "title": "Nano: Add Missing Renames Commit Message", "summary": "", "content": "", "steps": [ { "id": "1735.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "744d596484aa5f31368c4ba24ef42517087da703" ] }, "content": "The lines that don't start with a `#` will be the commit messages. Add a new message at the top of the file on it's own line. Give it the text, `fix: add missing rename references`. When you are done, save and exit the file.", "hints": [ "You can save and exit nano by pressing `ctrl+x` then `y` then `enter`", "The most recent commit message should be `fix: add missing rename references`", "To reset this lesson, make sure nano is closed. Then, hit reset and enter `git rebase --interactive HEAD~2` after it's done resetting. Then, in nano, replace `pick` with `s` next to your `fix: add missing rename table reference` commit, and save and exit" ] } ] }, { "id": "1737", "title": "git log -1", "summary": "", "content": "", "steps": [ { "id": "1737.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a2d17a09585859e5aedaa5e6481df2194b8c8498" ] }, "content": "View only the last commit in your log to see your squashed commit.", "hints": [ "Use the `git log` command", "View the last `x` number of commits with `-x`", "Use `-1` with the command", "Type `git log -1` into the terminal and press enter" ] } ] }, { "id": "1740", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "1740.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "a18d6d606448819f821442bebcac934f44163c54" ] }, "content": "I think this branch is ready to go. Switch to `main` so you can merge it.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "1750", "title": "git merge fix/add-missing-rename-references", "summary": "", "content": "", "steps": [ { "id": "1750.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "2d7c951bc0d8aa83da84b7ac11e10a43b0aebb29" ] }, "content": "Merge your branch for adding the rename commands into `main`.", "hints": [ "Use the `git merge` command with the branch name after it", "Here's an example: `git merge branch_name`", "Use the `git branch` command if you need to find the branch name", "It's the `fix/add-missing-rename-references` branch", "Type `git merge fix/add-missing-rename-references` into the terminal and press enter" ] } ] }, { "id": "1760", "title": "git branch", "summary": "", "content": "", "steps": [ { "id": "1760.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "4522e594089b99835c7ec7defc928ea956af345c" ] }, "content": "View your branches.", "hints": [ "Use `git branch` to view your branches", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1770", "title": "git branch -d all but main", "summary": "", "content": "", "steps": [ { "id": "1770.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "7de9d8e7a705de173f10b745591f323275f1cc55" ] }, "content": "Delete all your branches except `main`.", "hints": [ "Use the `git branch` command with the `-d` flag", "Here's an example: `git branch -d branch_name`", "The branch name is `fix/add-missing-rename-references`", "Type `git branch -d fix/add-missing-rename-references` into the terminal and press enter" ] } ] }, { "id": "1780", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "1780.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "c8bd363ec0e595ed6c0744adcdd66e1fb5c21227" ] }, "content": "I think the file is complete, thanks for making this for me. View the log with the oneline flag.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "1790", "title": "git checkout -b feat/add-gitignore", "summary": "", "content": "", "steps": [ { "id": "1790.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "ffc75ae5544940528af3267f38df81c39abde7ed" ] }, "content": "That's a nice looking commit history. There's one more thing you should learn. Create and checkout a branch named `feat/add-gitignore`.", "hints": [ "Use the `git checkout` command with the `-b` flag", "Here's an example: `git checkout -b branch_name`", "Type `git checkout -b feat/add-gitignore` into the terminal and press enter" ] } ] }, { "id": "1800", "title": "touch .env", "summary": "", "content": "", "steps": [ { "id": "1800.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "c11af6ec7d81aff8b91a09ff16a8cfe58ba551e3" ] }, "content": "Use the `touch` command to create a file named `.env` in your repo.", "hints": [ "Use `touch file_name` to create a file", "Type `touch .env` into the terminal and press enter", "Don't try to create the file with another method", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1810", "title": "Add SECRETS to .env", "summary": "", "content": "", "steps": [ { "id": "1810.1", "setup": { "watchers": [ "./sql_reference/.env" ], "commits": [ "a973df15e984a82a5ebeaa97201d6961a4aab0c5" ] }, "content": "`.env` files are used to store environment variables for running code. Often times, there may be sensitive information in it. Add the text `SECRET=MY_SECRET` to the file.", "hints": [ "Add the suggested text to the `.env` file", "Add `SECRET=MY_SECRET` to the `.env` file", "Make sure there's nothing else in the file" ] } ] }, { "id": "1820", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "1820.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "7a98ac38abbad880487a56c9b36b9d1db49c6279" ] }, "content": "View your status.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1830", "title": "touch .gitignore", "summary": "", "content": "", "steps": [ { "id": "1830.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "9b364231f5a7f59821fd8c08673dd4af756b2459" ] }, "content": "You can see the `.env` file is new. Use `touch` again to create another file named `.gitignore` in your repo.", "hints": [ "Use `touch file_name` to create a file", "Type `touch .gitignore` into the terminal and press enter", "Don't try to create the file with another method", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1835", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "1835.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "cee3fb88b7d095003b5a66e2af31e4b2276b0097" ] }, "content": "View the status again.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1840", "title": "Add .env to .gitignore", "summary": "", "content": "", "steps": [ { "id": "1840.1", "setup": { "watchers": [ "./sql_reference/.gitignore" ], "commits": [ "4201e8a1f7e03b6a92dc33297e9f5544f137057b" ] }, "content": "Now there's two new files that aren't tracked yet. Add the text `.env` to your `.gitignore` file.", "hints": [ "Add `.env` to the `.gitignore` file", "Make sure there's nothing else in the file" ] } ] }, { "id": "1850", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "1850.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "854b6354fdd92387de6d63a2c80cfe15f30af18f" ] }, "content": "View the status again.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1860", "title": "git add .gitignore", "summary": "", "content": "", "steps": [ { "id": "1860.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "81e317647a0bc1f8b5efd64c9bec6f2ce20a189d" ] }, "content": "Now the `.env` file is being ignored by git because you added it to the `.gitignore` file. There are often a number of things you don't want to include in a repository, especially if it's publicly visible. Now, you know how to keep them from being tracked by git. Add your new changes to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add sql_reference.json` to add changes to staging", "Type `git add .gitignore` into the terminal and press enter" ] } ] }, { "id": "1870", "title": "git commit feat: add .gitignore", "summary": "", "content": "", "steps": [ { "id": "1870.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "d1a835b58de9c3e711c1c5819bde04e8e1fd03fe" ] }, "content": "Commit your changes with `feat: add .gitignore` for the message.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add .gitignore\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1880", "title": "touch sample.env", "summary": "", "content": "", "steps": [ { "id": "1880.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "4e585622dfaf83a5069d0132f88a5508d46f4cfb" ] }, "content": "Use touch to create another file named `sample.env` in your repo.", "hints": [ "Use `touch file_name` to create a file", "Type `touch sample.env` into the terminal and press enter", "Don't try to create the file with another method", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1890", "title": "git status", "summary": "", "content": "", "steps": [ { "id": "1890.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "68b92388a2e707982499eb9ed5efa02b9251cf5d" ] }, "content": "View the status.", "hints": [ "Use the \"git status\" command in your repo", "Type `git status` into the terminal and press enter", "Make sure you are in your `sql_reference` repo folder" ] } ] }, { "id": "1900", "title": "Add SECRET= to sample.env", "summary": "", "content": "", "steps": [ { "id": "1900.1", "setup": { "watchers": [ "./sql_reference/sample.env" ], "commits": [ "2759fe7b592146ffec47c088e22b109bc126666e" ] }, "content": "Git won't ignore this file. Sensitive information can be stored in the `.env` file, but people need to know the variables that are in there so they can run a repository locally. Add `SECRET=` to `sample.env`.", "hints": [ "Add the suggested text to the `sample.env` file" ] } ] }, { "id": "1930", "title": "git add sample.env", "summary": "", "content": "", "steps": [ { "id": "1930.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "1f5e1ae0efa482c8042c860ec419c00e1b9e5cd3" ] }, "content": "Now, when someone wants to run your repo, they will know that they need to create a `.env` file and add a value in it for `SECRET`. Add your new file to staging.", "hints": [ "Use the `git add` command", "Here's an example: `git add file_name`", "You previously used `git add sql_reference.json` to add changes to staging", "Type `git add sample.env` into the terminal and press enter" ] } ] }, { "id": "1940", "title": "git commit feat: add sample.env", "summary": "", "content": "", "steps": [ { "id": "1940.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "0a65a40e0fb658da442ecd460187931b9f2a9995" ] }, "content": "Commit the new changes with the message `feat: add sample.env`.", "hints": [ "Commit changes with `git commit -m \"message\"`", "Type `git commit -m \"feat: add sample.env\"` into the terminal and press enter", "View your `git log` to see if your message is correct", "If the message is wrong, enter `git reset HEAD~1`, then `git add .`, and then you can try to make the commit again", "Or, reset the lesson and try again" ] } ] }, { "id": "1945", "title": "git log -5 oneline", "summary": "", "content": "", "steps": [ { "id": "1945.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "f3ff72cd4dd86ffea5ac92f7b16cb3ad532d6171" ] }, "content": "View the last five commits in your log with the oneline flag.", "hints": [ "Use the `git log` command with two flags", "Use `-5` and `--oneline` with the command", "Type `git log -5 --oneline` into the terminal and press enter" ] } ] }, { "id": "1950", "title": "git rebase HEAD~2", "summary": "", "content": "", "steps": [ { "id": "1950.1", "setup": { "watchers": [ "./.freeCodeCamp/test/.next_command" ], "commits": [ "2beac770fe36f9ee21b2e2fb459c1677da8b5f05" ] }, "content": "The two commits you made to this branch can be squashed. Do an interactive rebase that goes back to all the commits unique to this branch (`HEAD~2`).", "hints": [ "It's the `git rebase` command with two arguments", "Use `--interactive` and `HEAD~2` with the command", "Enter `git rebase --interactive HEAD~2` into the terminal and press enter" ] } ] }, { "id": "1960", "title": "Nano: Squash feat/add-gitignore Commits", "summary": "", "content": "", "steps": [ { "id": "1960.1", "setup": { "watchers": [ "./sql_reference/.git/rebase-merge/done" ], "commits": [ "21b6cbb53155a41dd5e725dc4d05c3c90984228a" ] }, "content": "Squash your commit that was for adding the `sample.env` file. When you are done, save the file and exit Nano.", "hints": [ "Replace `pick` with `s` next to the suggested commit", "It's the `feat: add sample.env` commit", "You can save and exit by pressing `ctrl+x` then `y` then `enter`", "To reset this lesson, make sure nano is closed. Then, hit reset and enter `git rebase --interactive HEAD~2` after it's done resetting" ] } ] }, { "id": "1962", "title": "Nano: Add Message + Save and Exit", "summary": "", "content": "", "steps": [ { "id": "1962.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "acccc2c1e099935f940af7ae03ee7805b9c9e793" ] }, "content": "Add a new message at the very top of the file, `feat: add .gitignore and sample.env`. When you are done, save and exit the file.", "hints": [ "Add the suggested message on it's own line above the other messages", "You can save and exit by pressing `ctrl+x` then `y` then `enter`", "The most recent commit message should be `feat: add .gitignore and sample.env`", "To reset this lesson, make sure nano is closed. Then, hit reset and enter `git rebase --interactive HEAD~2` after it's done resetting. Then, in nano, replace `pick` with `s` next to your `feat: add sample.env` commit, and save and exit" ] } ] }, { "id": "1964", "title": "git log -1", "summary": "", "content": "", "steps": [ { "id": "1964.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "9b86c468a157db330662ccbb429143d5ac1d8996" ] }, "content": "View only the last commit in your log.", "hints": [ "Use the `git log` command with the correct argument", "View the last `x` number of commits with `-x`", "Use `-1` with the command", "Type `git log -1` into the terminal and press enter" ] } ] }, { "id": "1970", "title": "git checkout main", "summary": "", "content": "", "steps": [ { "id": "1970.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "45d25b3cbaf42ac2c05cc26d336b4155d3b3eb32" ] }, "content": "Switch back to `main` so you can add this in.", "hints": [ "Use the `git checkout` command", "Here's an example: `git checkout branch_name`", "Enter `git checkout main` into the terminal and press enter" ] } ] }, { "id": "1980", "title": "git merge feat/add-gitignore", "summary": "", "content": "", "steps": [ { "id": "1980.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "628c207fae8c71917d8038e76d0e865905d5ae8a" ] }, "content": "Merge the branch you just made into here.", "hints": [ "Use the `git merge` command with the branch name after it", "Here's an example: `git merge branch_name`", "Use the `git branch` command if you need to find the branch name", "It's the `feat/add-gitignore` branch", "Type `git merge feat/add-gitignore` into the terminal and press enter", "If you got `fatal: refusing to merge unrelated histories`, you need to switch back to the feature branch, enter `git rebase main` to align the histories, then come back to `main` and try again" ] } ] }, { "id": "1990", "title": "git branch -d feat/add-gitignore", "summary": "", "content": "", "steps": [ { "id": "1990.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "1a22880aabac1b9f94a9a3942d18f108ee8007d4" ] }, "content": "Delete the feature branch you just merged.", "hints": [ "Use the `git branch` command with the `-d` flag", "Here's an example: `git branch -d branch_name`", "Use just `git branch` if you need to find the branch name", "The branch name is `feat/add-gitignore`", "Type `git branch -d feat/add-gitignore` into the terminal and press enter" ] } ] }, { "id": "1995", "title": "git log oneline", "summary": "", "content": "", "steps": [ { "id": "1995.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "3c49416bf14c769606141c80e658041c2b0a47bc" ] }, "content": "I think it's all finished. View your log with the oneline flag to see your whole history.", "hints": [ "Use the `git log` command with the correct flag", "It's the `--oneline` flag", "Type `git log --oneline` into the terminal and press enter" ] } ] }, { "id": "2000", "title": "git log", "summary": "", "content": "", "steps": [ { "id": "2000.1", "setup": { "watchers": [ "../.bash_history" ], "commits": [ "0ac69ca8cfff951d6942b14b4f7bcaa3c8e4f46b" ] }, "content": "Looks great :smile: View the log one last time, without any flags, to see the details of all the commits. Congratulations, you are finished with your repo for now.", "hints": [ "Use the `git log` command", "Don't use any flags with the command", "Press enter until you have seen the whole log" ] } ] } ] }