├── 01-basic_git_commands ├── README.md ├── commands.sh └── story.txt ├── 02-git_commit ├── README.md ├── commands.sh └── story.txt ├── 03-untrack_files ├── README.md ├── commands.sh ├── password.txt ├── song.txt └── story.txt ├── 04-git_log ├── README.md ├── commands.sh ├── password.txt ├── song.txt └── story.txt ├── 05-git_reset ├── README.md ├── commands.sh ├── password.txt ├── song.txt └── story.txt ├── 06-gitignore ├── .gitignore ├── README.md ├── commands.sh ├── song.txt └── story.txt └── README.md /01-basic_git_commands/README.md: -------------------------------------------------------------------------------- 1 | # Git Basics 2 | 3 | Here we take our first look at how to us Git! Git is a very powerful command-line that is very commonly used by developers to back up manage their codebases 4 | 5 | ## Technologies Used 6 | 7 | In this project we used Git from the terminal 8 | 9 | ## Caveats 10 | In the videos we tell you not to commit the *password.txt*, which is always the best practice. The reason that we have provided the *password.txt* file so you can see what each of your files are supposed to look like at the end of each video -------------------------------------------------------------------------------- /01-basic_git_commands/commands.sh: -------------------------------------------------------------------------------- 1 | # The set of commands that were used in the `Basic Git Commands` video 2 | 3 | # Make sure the directory is empty 4 | ls 5 | 6 | # Output some text to a `story.txt` file 7 | echo "Once upon a time" >> story.txt 8 | 9 | # Ensure that the file exists in the current folder 10 | ls 11 | 12 | # Initialize a local git repository 13 | git init 14 | 15 | # Show everything present in the current directory, including hidden 16 | # files and folders 17 | ls -a 18 | 19 | # Show the status of the repository 20 | git status -------------------------------------------------------------------------------- /01-basic_git_commands/story.txt: -------------------------------------------------------------------------------- 1 | Once upon a time 2 | -------------------------------------------------------------------------------- /02-git_commit/README.md: -------------------------------------------------------------------------------- 1 | # Git Basics 2 | 3 | Here we take our first look at how to us Git! Git is a very powerful command-line that is very commonly used by developers to back up manage their codebases 4 | 5 | ## Technologies Used 6 | 7 | In this project we used Git from the terminal 8 | 9 | ## Caveats 10 | In the videos we tell you not to commit the *password.txt*, which is always the best practice. The reason that we have provided the *password.txt* file so you can see what each of your files are supposed to look like at the end of each video -------------------------------------------------------------------------------- /02-git_commit/commands.sh: -------------------------------------------------------------------------------- 1 | # The set of commands that were used in the `Git Commit` video 2 | 3 | # Add the file to git's staging area, so we can commit it 4 | git add story.txt 5 | 6 | # Check the status of the repository 7 | git status 8 | 9 | # Commit the changes 10 | git commit -m "Initial commit" 11 | 12 | # Check the status of the repository after the commit 13 | git status 14 | 15 | # Update the `story.txt` file 16 | nano story.txt 17 | 18 | # Check the status again 19 | git status 20 | 21 | # Add the file to the staging area 22 | git add story.txt 23 | 24 | # Commit 25 | git commit -m "Expand story" 26 | 27 | # Ensure the working tree is clean 28 | git status -------------------------------------------------------------------------------- /02-git_commit/story.txt: -------------------------------------------------------------------------------- 1 | Once upon a time 2 | There was a wicked witch -------------------------------------------------------------------------------- /03-untrack_files/README.md: -------------------------------------------------------------------------------- 1 | # Git Basics 2 | 3 | Here we take our first look at how to us Git! Git is a very powerful command-line that is very commonly used by developers to back up manage their codebases 4 | 5 | ## Technologies Used 6 | 7 | In this project we used Git from the terminal 8 | 9 | ## Caveats 10 | In the videos we tell you not to commit the *password.txt*, which is always the best practice. The reason that we have provided the *password.txt* file so you can see what each of your files are supposed to look like at the end of each video -------------------------------------------------------------------------------- /03-untrack_files/commands.sh: -------------------------------------------------------------------------------- 1 | # The set of commands that were used in the `Git Commit` video 2 | 3 | # Create a new file called `song.txt` with some song lyrics 4 | echo "On a dark desert highway" >> song.txt 5 | 6 | # Add a password word to a new `password.txt` file 7 | echo "pas55w0rd" >> password.txt 8 | 9 | # Check the status 10 | git status 11 | 12 | # Add all of the untracked files to the staging area 13 | git add . 14 | 15 | # Check the status 16 | git status 17 | 18 | # Untrack the `password.txt` 19 | git rm --cached password.txt 20 | 21 | # Ensure the file is now untracked 22 | git status 23 | 24 | # Commit 25 | git commit -m "Add song lyrics" -------------------------------------------------------------------------------- /03-untrack_files/password.txt: -------------------------------------------------------------------------------- 1 | pas55w0rd 2 | -------------------------------------------------------------------------------- /03-untrack_files/song.txt: -------------------------------------------------------------------------------- 1 | On a dark desert highway 2 | -------------------------------------------------------------------------------- /03-untrack_files/story.txt: -------------------------------------------------------------------------------- 1 | Once upon a time 2 | There was a wicked witch -------------------------------------------------------------------------------- /04-git_log/README.md: -------------------------------------------------------------------------------- 1 | # Git Basics 2 | 3 | Here we take our first look at how to us Git! Git is a very powerful command-line that is very commonly used by developers to back up manage their codebases 4 | 5 | ## Technologies Used 6 | 7 | In this project we used Git from the terminal 8 | 9 | ## Caveats 10 | In the videos we tell you not to commit the *password.txt*, which is always the best practice. The reason that we have provided the *password.txt* file so you can see what each of your files are supposed to look like at the end of each video -------------------------------------------------------------------------------- /04-git_log/commands.sh: -------------------------------------------------------------------------------- 1 | # The set of commands that were used in the `Git Log` video 2 | 3 | # Update the `story.txt` file 4 | echo "Who thought she was queen of the land" >> story.txt 5 | 6 | # Check the status 7 | git status 8 | 9 | # See the changes between the current version of the file and the previous version 10 | git diff story.txt 11 | 12 | # Once we're happy with the change we can add the file to the staging area 13 | git add story.txt 14 | 15 | # And then commit it 16 | git commit -m "Added to story" 17 | 18 | # Check the status 19 | git status 20 | 21 | # View list of commits made to the repository by viewing the log 22 | git log -------------------------------------------------------------------------------- /04-git_log/password.txt: -------------------------------------------------------------------------------- 1 | pas55w0rd 2 | -------------------------------------------------------------------------------- /04-git_log/song.txt: -------------------------------------------------------------------------------- 1 | On a dark desert highway 2 | -------------------------------------------------------------------------------- /04-git_log/story.txt: -------------------------------------------------------------------------------- 1 | Once upon a time 2 | There was a wicked witch 3 | Who thought she was queen of the land -------------------------------------------------------------------------------- /05-git_reset/README.md: -------------------------------------------------------------------------------- 1 | # Git Basics 2 | 3 | Here we take our first look at how to us Git! Git is a very powerful command-line that is very commonly used by developers to back up manage their codebases 4 | 5 | ## Technologies Used 6 | 7 | In this project we used Git from the terminal 8 | 9 | ## Caveats 10 | In the videos we tell you not to commit the *password.txt*, which is always the best practice. The reason that we have provided the *password.txt* file so you can see what each of your files are supposed to look like at the end of each video -------------------------------------------------------------------------------- /05-git_reset/commands.sh: -------------------------------------------------------------------------------- 1 | # The set of commands that were used in the `Git Reset` video 2 | 3 | # View the git log 4 | git log 5 | 6 | # Resest the repository to a previous commit. 7 | # NOTE: the SHA will be unique to your logs 8 | # Check the log, find the commit for "Add song lyrics" and get the 9 | # first 6 characters from that commit's SHA 10 | git reset --hard FIRST_SIX_CHARACTERS_OF_YOUR_SHA 11 | 12 | # Status 13 | git status 14 | 15 | # Add the new changes 16 | git add story.txt 17 | 18 | # Commit the changes 19 | git commit -m "Update story" -------------------------------------------------------------------------------- /05-git_reset/password.txt: -------------------------------------------------------------------------------- 1 | pas55w0rd 2 | -------------------------------------------------------------------------------- /05-git_reset/song.txt: -------------------------------------------------------------------------------- 1 | On a dark desert highway 2 | -------------------------------------------------------------------------------- /05-git_reset/story.txt: -------------------------------------------------------------------------------- 1 | Once upon a time 2 | There was a wicked witch 3 | Way up in the mountain -------------------------------------------------------------------------------- /06-gitignore/.gitignore: -------------------------------------------------------------------------------- 1 | password.txt -------------------------------------------------------------------------------- /06-gitignore/README.md: -------------------------------------------------------------------------------- 1 | # Git Basics 2 | 3 | Here we take our first look at how to us Git! Git is a very powerful command-line that is very commonly used by developers to back up manage their codebases 4 | 5 | ## Technologies Used 6 | 7 | In this project we used Git from the terminal 8 | 9 | ## Caveats 10 | In the videos we tell you not to commit the *password.txt*, which is always the best practice. The reason that we have provided the *password.txt* file so you can see what each of your files are supposed to look like at the end of each video -------------------------------------------------------------------------------- /06-gitignore/commands.sh: -------------------------------------------------------------------------------- 1 | # The set of commands that were used in the `Gitignore` video 2 | 3 | # Create a .gitignore file and tell it to ignore the `password.txt` file 4 | echo "password.txt" >> .gitignore 5 | 6 | # Check to ensure that the file was created 7 | ls -a 8 | 9 | # Check the status 10 | git status 11 | 12 | # Add the file to staging 13 | git add .gitignore 14 | 15 | # Commit 16 | git commit -m "Add .gitignore file" 17 | -------------------------------------------------------------------------------- /06-gitignore/song.txt: -------------------------------------------------------------------------------- 1 | On a dark desert highway 2 | -------------------------------------------------------------------------------- /06-gitignore/story.txt: -------------------------------------------------------------------------------- 1 | Once upon a time 2 | There was a wicked witch 3 | Way up in the mountain -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git Basics 2 | 3 | The repo contains the solution code for the *Git Basics* lesson. 4 | 5 | ## Contents 6 | This solution contains solution code to the following units - 7 | 1. *01-basic_git_commands* 8 | 2. *02-git_commit* 9 | 3. *03-untrack_files* 10 | 4. *04-git_log* 11 | 5. *05-git_reset* 12 | 6. *06-gitignore* --------------------------------------------------------------------------------