Tech Thursday Assignment - 16-08-2025 #1

Open
opened 2025-08-16 05:02:46 +00:00 by jebin.jebamony · 0 comments
Member

Git Assignment - 16-08-2025

Create Repository in Organization

Assignment:

  • Go to the Git-Training-Hub organization on Git Comorin.
  • Create a new repository inside the organization (name it something like git-practice-<your_name>).
  • Make sure it is empty (no README, no .gitignore, no license).
  • Document this step in your final GIT_ASSIGNMENT.md with a screenshot showing the repo inside the organization.

1. What is Git and Version Control

Assignment:

  • Write down (in your own words) what problem Git solves.
  • Find one real-life example where multiple people edit the same file (school project, code, Google Docs).
  • Answer: Why is version control better than emailing files back and forth?

2. Installing Git & Configuring User Info

Assignment:

  • Install Git (if not already installed).

  • Run:

    git --version
    git config --global user.name "Your Name"
    git config --global user.email "your@email.com"
    
  • Verify with:

    git config --list
    

3. Initializing a Repository

Assignment:

  • Create a new folder git-practice-<<your_name>>.

  • Inside, run:

    git init
    
  • Verify that a .git folder is created.

  • Run git status and note the message (it should say “No commits yet”).


4. Working Directory, Staging, and Commits

Assignment:

  • In git-practice-<<your_name>>, create a file notes.txt.

  • Run:

    git status
    
  • Observe which area (untracked → staged → committed) the file is in as you do:

    git add notes.txt
    git commit -m "Add first notes file"
    git status
    
  • Write down how the status changed after each command.


5. Adding & Committing Files

Assignment:

  • Add another file todo.txt.
  • Stage and commit with a meaningful message.
  • Modify todo.txt, then commit the change again.
  • Run git log --oneline to see both commits.

6. Viewing Commit Logs & Diffs

Assignment:

  • Run:

    git log
    git log --oneline --graph
    git diff
    
  • Edit notes.txt and check the changes with git diff before staging.

  • Stage and commit, then run git diff commit1 commit2 to see what changed between commits.


7. Creating & Switching Branches

Assignment:

  • Create a branch feature/feature-1:

    git branch feature/feature-1
    git checkout feature/feature-1
    
  • Add a line to notes.txt and commit it.

  • Switch back to main:

    git checkout main
    
  • Observe how the file content changes.


8. Cloning a Remote Repository

Assignment:

  • Go to Git Comorin and verify your repo in Git-Training-Hub exists.

  • Run:

    git clone <your-repo-url> cloned-repo
    
  • Verify by listing files inside cloned-repo.


9. Adding & Managing Remotes

Assignment:

  • In your original git-practice-<<your_name>> repo, add a remote:

    git remote add origin <your-repo-url>
    git remote -v
    
  • Verify the remote shows correctly.


10. Pushing & Pulling Changes

Assignment:

  • Push local commits to Git Comorin:

    git push -u origin main
    
  • Edit a file directly on Git Comorin and commit it there.

  • In your local repo, run:

    git pull origin main
    
  • Verify that the local file updates.


11. Ignoring Files with .gitignore

Assignment:

  • In your repo, create a file secret.txt.

  • Create .gitignore and add:

    secret.txt
    
  • Run git status → confirm secret.txt is ignored.

  • Commit the .gitignore file.


Final Assignment Summary

  1. Create a new project folder and initialize Git.
  2. Add and commit at least two files.
  3. View logs and diffs.
  4. Create a branch, make changes, and switch back.
  5. Create a Git Comorin repo in Git-Training-Hub, add it as a remote, and push.
  6. Clone the repo into another folder to verify it works.
  7. Add a .gitignore file to exclude something.
  8. Document all steps in GIT_ASSIGNMENT.md with screenshots of key commands and the repository inside the organization.
# **Git Assignment - 16-08-2025** ## **Create Repository in Organization** **Assignment:** * Go to the [**Git-Training-Hub**](https://git.comorin.co/Git-Training-Hub) organization on Git Comorin. * Create a **new repository** inside the organization (name it something like `git-practice-<your_name>`). * Make sure it is **empty (no README, no .gitignore, no license)**. * Document this step in your final `GIT_ASSIGNMENT.md` with a screenshot showing the repo inside the organization. --- ## **1. What is Git and Version Control** **Assignment:** * Write down (in your own words) what problem Git solves. * Find one real-life example where multiple people edit the same file (school project, code, Google Docs). * Answer: *Why is version control better than emailing files back and forth?* --- ## **2. Installing Git & Configuring User Info** **Assignment:** * Install Git (if not already installed). * Run: ```bash git --version git config --global user.name "Your Name" git config --global user.email "your@email.com" ``` * Verify with: ```bash git config --list ``` --- ## **3. Initializing a Repository** **Assignment:** * Create a new folder `git-practice-<<your_name>>`. * Inside, run: ```bash git init ``` * Verify that a `.git` folder is created. * Run `git status` and note the message (it should say “No commits yet”). --- ## **4. Working Directory, Staging, and Commits** **Assignment:** * In `git-practice-<<your_name>>`, create a file `notes.txt`. * Run: ```bash git status ``` * Observe which area (untracked → staged → committed) the file is in as you do: ```bash git add notes.txt git commit -m "Add first notes file" git status ``` * Write down how the status changed after each command. --- ## **5. Adding & Committing Files** **Assignment:** * Add another file `todo.txt`. * Stage and commit with a meaningful message. * Modify `todo.txt`, then commit the change again. * Run `git log --oneline` to see both commits. --- ## **6. Viewing Commit Logs & Diffs** **Assignment:** * Run: ```bash git log git log --oneline --graph git diff ``` * Edit `notes.txt` and check the changes with `git diff` before staging. * Stage and commit, then run `git diff commit1 commit2` to see what changed between commits. --- ## **7. Creating & Switching Branches** **Assignment:** * Create a branch `feature/feature-1`: ```bash git branch feature/feature-1 git checkout feature/feature-1 ``` * Add a line to `notes.txt` and commit it. * Switch back to `main`: ```bash git checkout main ``` * Observe how the file content changes. --- ## **8. Cloning a Remote Repository** **Assignment:** * Go to Git Comorin and verify your repo in **Git-Training-Hub** exists. * Run: ```bash git clone <your-repo-url> cloned-repo ``` * Verify by listing files inside `cloned-repo`. --- ## **9. Adding & Managing Remotes** **Assignment:** * In your original `git-practice-<<your_name>>` repo, add a remote: ```bash git remote add origin <your-repo-url> git remote -v ``` * Verify the remote shows correctly. --- ## **10. Pushing & Pulling Changes** **Assignment:** * Push local commits to Git Comorin: ```bash git push -u origin main ``` * Edit a file directly on Git Comorin and commit it there. * In your local repo, run: ```bash git pull origin main ``` * Verify that the local file updates. --- ## **11. Ignoring Files with .gitignore** **Assignment:** * In your repo, create a file `secret.txt`. * Create `.gitignore` and add: ``` secret.txt ``` * Run `git status` → confirm `secret.txt` is ignored. * Commit the `.gitignore` file. --- ## **Final Assignment Summary** 1. Create a **new project folder** and initialize Git. 2. Add and commit at least **two files**. 3. View **logs and diffs**. 4. Create a **branch**, make changes, and switch back. 5. Create a **Git Comorin repo in Git-Training-Hub**, add it as a remote, and **push**. 6. Clone the repo into another folder to verify it works. 7. Add a `.gitignore` file to exclude something. 8. **Document all steps in `GIT_ASSIGNMENT.md` with screenshots** of key commands and the repository inside the organization.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Git-Training-Hub/tech-thursday-demo#1
No description provided.