AboutΒ Β Β |Β Β Β StructureΒ Β Β |Β Β Β Getting StartedΒ Β Β |Β Β Β Submit WorkΒ Β Β |Β Β Β Help
π Code Academy | Brandlovers π
Welcome to the Code Academy learning repository! This is your space to learn, practice, and grow as a programmer.
This repository is designed as a collaborative learning environment where:
- Instructors provide lessons and exercises
- Students submit their work for review and feedback
- Everyone learns together through code!
The repository follows this organized structure:
code-academy/
βββ README.md # This file - your guide to the repository
βββ .gitignore # Files that Git should ignore
βββ [student-name]/ # Your personal folder (replace with your actual name)
βββ lesson-01/ # Folder for lesson 1 exercises
βββ lesson-02/ # Folder for lesson 2 exercises
βββ ... # More lessons as you progress
code-academy/
βββ john-doe/
β βββ lesson-01/
β β βββ hello-world.js
β β βββ variables.js
β βββ lesson-02/
β βββ functions.js
β βββ arrays.js
βββ jane-smith/
βββ lesson-01/
β βββ my-first-program.py
βββ lesson-02/
βββ learning-loops.py
Git is a version control system that tracks changes in your code. Think of it as a "save game" system for your code!
- Windows: Download from git-scm.com
- Mac: Install via Terminal:
brew install git(requires Homebrew) - Linux:
sudo apt-get install git(Ubuntu/Debian) orsudo yum install git(Fedora)
Cloning means downloading a copy of this repository to your computer:
# This command creates a copy of the repository on your computer
git clone [repository-url]
# Navigate into the repository folder
cd code-academyCreate a folder with your name (use lowercase and hyphens instead of spaces):
# Create your folder (replace 'your-name' with your actual name)
mkdir your-name
# Example: if your name is John Doe
mkdir john-doeFor each lesson, create a new folder inside your personal folder:
# Navigate to your folder
cd your-name
# Create a lesson folder
mkdir lesson-01
# Navigate into the lesson folder
cd lesson-01Here's how to save and submit your work. Think of this as a 3-step process:
- Stage - Select which files to save
- Commit - Save the files with a description
- Push - Upload to the online repository
# 1. Check what files have changed
git status
# This shows you what files are new or modified
# 2. Add your files to the staging area
git add .
# The dot (.) means "add all changed files in current folder"
# You can also add specific files: git add filename.js
# 3. Commit your changes with a meaningful message
git commit -m "Add lesson 1 hello world exercise"
# The message should describe WHAT you did and WHY
# 4. Push your changes to GitHub
git push origin main
# This uploads your changes so instructors can see themGood commit messages help everyone understand what changed:
# β
Good commit messages:
git commit -m "Complete lesson 1 variables exercise"
git commit -m "Fix syntax error in functions.js"
git commit -m "Add solution for array sorting challenge"
# β Avoid vague messages like:
git commit -m "Fixed stuff"
git commit -m "Updates"
git commit -m "asdfasdf"Consistent naming helps keep the repository organized:
- Use lowercase letters
- Use hyphens instead of spaces
- Be descriptive
β
Good: john-doe, lesson-01, bonus-exercises
β Bad: JohnDoe, Lesson 1, my stuff
- Use lowercase letters
- Use hyphens or underscores
- Include the file extension (.js, .py, .html, etc.)
- Be descriptive about what the file contains
β
Good: hello-world.js, calculate_average.py, index.html
β Bad: HelloWorld.js, file1.py, untitled.txt
# Check current status
git status
# View commit history
git log --oneline
# Pull latest changes from repository
git pull origin main
# Create and switch to a new branch (advanced)
git checkout -b feature-name
# Switch between branches (advanced)
git checkout branch-name
# See what changed in your files
git diff
# Unstage files (if you added by mistake)
git reset HEAD filename
# Discard local changes to a file
git checkout -- filename- Make sure you have the correct access rights to the repository
- Contact your instructor for access
- This happens when two people edit the same file
- Ask your instructor for help resolving conflicts
- This means no files have changed
- Make sure you saved your files before committing
# Save your current work
git stash
# Pull the latest changes
git pull origin main
# Restore your work
git stash popIf you're stuck:
- Check this README - The answer might be here!
- Google the error message - Someone else has probably had the same problem
- Ask a classmate - Collaboration is encouraged!
- Ask your instructor - That's what they're here for!
- Always pull before you start working to get the latest changes
- Commit frequently - It's better to have many small commits than one large one
- Write meaningful commit messages - Future you will thank present you
- Don't commit sensitive information like passwords or API keys
- Test your code before committing - Make sure it works!
- Ask questions - There are no stupid questions when learning
Before submitting each assignment, make sure:
- Your code is in the correct folder (your-name/lesson-XX/)
- All files are saved
- Your code runs without errors
- You've added all new files with
git add - You've committed with a descriptive message
- You've pushed your changes with
git push - You can see your changes on GitHub (web browser)
- Repository (Repo): A folder that contains all your project files and their history
- Clone: Download a copy of a repository to your computer
- Commit: A saved snapshot of your changes
- Push: Upload your commits to GitHub
- Pull: Download changes from GitHub to your computer
- Branch: A separate version of your code (like a parallel universe)
- Merge: Combine changes from different branches
- Fork: Create your own copy of someone else's repository
- Pull Request (PR): Ask to merge your changes into the main repository
Remember: Everyone was a beginner once. Don't be afraid to make mistakes - that's how we learn! π
Happy coding! π»β¨