Assignment 5: Initial Git Setup (Local only)
Task 1 — Create a Local Project Directory
Steps:
- Initialize the CodeTrack Repository
- Create a new folder named CodeTrack.
- Initialize it as a Git repository using git init.
- Uploaded a screenshot showing the terminal with the initialized repository (Initialized empty Git
repository…) or the .git folder listed with ls -a
Task 2 — Configure Git Locally for CodeTrack
Steps:
- Configure Git Locally
- Inside the CodeTrack repository, set up your local Git identity with your name and email.
- Run git config --local --list to verify.
- Uploaded a screenshot showing my configured user.name and user.email.
3
Task 3 — Configure Git Globally (Optional, Recommended)
Steps:
- Set up my global Git identity (name and email).
- Run git config --global --list to verify.
When would you prefer to use local configuration instead of global configuration?
Ans: I would prefer to use local configuration over global configuration when working as a
freelancer and working with different client with different email ID.
Assignment 6: Tracking and Staging Changes in a CodeTrack Project
Task 1: Create and Modify Files
Steps
- Created index.html and style.css using “echo” command
- Verify that the files have been created by listing the directory contents: using “ls”
- Modified index.html and style.css by going to GitHub repository week 2 assignment
- Then Copied entire code and paste them in the same files as my project
-
Task 2: Staging Stages
-Check the repository status: git status
-Stage the files for tracking: git add
-Stage them one by one:
git add index.html
git add style.css
- Verify that the files are now staged: git status
-Commit the changes with a message:
git commit -m "Meaningful message"
-Verify commit history again:
git log --oneline
-Expected Output:
Meaningful message
Initial commit - Added index.html and style.css
Task 3 — Deploy Your App on AWS EC2
Time to put your project live
1. 1. Launch an EC2 instance: Use Amazon Linux 2 (recommended).
2. Connect via SSH
-Open terminal in your Local Machine
-Use ssh to connect
3. Update Packages
4. Install Nginx
5. Start and Enable Nginx
6. Navigate to the CodeTrack folder and check the files. Change the ownership permission
7. Deploy files: Copy your project files (index.html, style.css) to Nginx’s web directory:
8. Access application: Open in browser: http://<Ec2-Public-IP>
Assignment 7: Branching Workflow — Add & Verify a Contact Page
Task1 : Start from your existing repo
Navigate to your existing CodeTrack project from the last assignment:
1. cd path/to/CodeTrack
2. git status
3. git branch
Ensure you’re on main (or master).
Task 2: Create and switch to a feature branch
1.git checkout -b feature/contact-page
2.git branch
2
Task 3: Add contact.html (in the branch)
-Create the file and add content: echo > contact.html
-Nano contact.html (To edit)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact - CodeTrack</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Contact Us</h1>
<p>Email:
[email protected]</p>
<p>Website: hhttps://thecloudadvisory.com/</p>
</body>
</html>
Stage & commit:
1
Task 4: Add a link to the contact page in index.html (still on the branch)
(Open index.html in an editor and insert the Contact Page link under the playlist paragraph.)
-git add index.html
➡ Stages the updated file.
git commit -m "feat(nav): add Contact Page link to index.html"
➡ Commits the modification with a descriptive message.
Task 5: Verify isolation (switch back to main)
1. git checkout main
2. ls
• contact.html should not be in main yet.
• Open index.html in your browser → the Contact Page link should not exist on main yet.
2
Step 5 — Merge the feature branch into main
- git merge feature/contact-page
Now verify:
• ls → contact.html is present.
• Open index.html in your browser → you should see the Contact Page link.
• Click the link → it should open contact.html
Step 6 — Inspect history (nice graph)
1. git log --oneline --graph --decorate –all (Optional cleanup)
2. git branch -d feature/contact-page
Explain why the link wasn’t visible before the merge and why it appears after?
The modifications reside in the feature/contact-page branch rather than the main/master branch.
These changes become part of the primary source code only after the branch is merged. Once
merged, the updates are reflected in the index.html file
Assignment 8: Setting Up GitHub for CodeTrack
Task 1: Create a GitHub Account
1. Visit GitHub → Sign Up.
2. Fill in email, password, username.
3. Verify → Create Account.
4. Land on your Dashboard. You now have your account set up
Task 2: Explore GitHub Features
1. From the top menu, click Explore.
2. Browse Trending Repositories to see what’s popular.
3. Use the search bar to find an open-source project (e.g., type theepicbook).
4. Click the Star button on a repository that interests you.
5. Click Fork on any public repository to create your own copy
Task:3 Update Your GitHub Profile
1. Click your profile picture (top-right) → Your Profile.
2. Click Edit Profile and:
• Add a short bio (e.g., “Cloud & DevOps Enthusiast | Learning Git & GitHub”).
• Optionally add location, company/school, and social links.
• Upload a profile picture (optional but recommended).
3. Save changes.
Why is it important to have a professional GitHub profile as a developer?
Your GitHub is your living resume for developers. A professional profile can set you apart in
competitive job markets.
Assignment 9: Collaborating on Mini-Finance with GitHub
Task 1: Access Existing Mini-Finance Code
The upstream repository exists at:
1. https://github.com/pravinmishraaws/mini_finance
We’ll fork this repository to your GitHub account, clone, and work with it.
Task 2: Fork & Authenticate
1. Login to GitHub and Fork the mini_finance repository into your account.
2. In your terminal, configure authentication if not already set:
• SSH (recommended):
1. ssh-keygen -t ed25519 -C "
[email protected]"
2. eval "$(ssh-agent -s)"
3. ssh-add ~/.ssh/id_ed25519
4. # Copy contents of ~/.ssh/id_ed25519.pub into your GitHub account
(Settings → SSH and GPG keys)
5. git config --global url."
[email protected]:".insteadOf "https://github.com/"
OR HTTPS:
6. git config --global credential.helper cache
Test with:
git ls-remote [email protected]:yourusername/mini_finance.git
Task 2: Clone Your Fork Locally
git clone [email protected]:yourusername/mini_finance.git
cd mini_finance
git remote -v
origin should point to your fork. Now add the upstream (original repo):
git remote add upstream https://github.com/pravinmishraaws/mini_finance.git
Task 3: Create a Feature Branch & Make a Change
1. Create a new branch:
git checkout -b feature-readme-update
2. Open README.md and add a new section:
You may write: “This project demonstrates Git operations like clone, pull, push, PR—a hands-on Mini-
Finance tool.”
3. Save, then stage and commit:
1. git add README.md
2. git commit -m "docs: update README with assignment note"
Task 4: Pull From Upstream & Push to Origin
A. Sync changes from upstream’s main:
1. git fetch upstream
2. git checkout main
3. git merge upstream/main
2.
B. Switch back to your feature branch:
1. git checkout feature-readme-update
2. git rebase main # optional but recommended
C. Push your branch to your fork:
1. git push -u origin feature-readme-update
Step 5 — Create a Pull Request
1. Go to your fork on GitHub.
2. Click Compare & Pull Request.
3. Make sure it’s targeting pravinmishraaws/mini_finance:main from your feature-readme-
update branch.
4. Title: “docs: update README with assignment note”
5. In the body, add a short description:
“This PR adds a new section to the README explaining the project's purpose in the context of this
GitHub assignment.”
6. Submit the Pull Request.
The changes I made earlier reflects
Why is creating a Pull Request an important step in team collaboration?
Ans: A Pull Request is important because it’s not just about merging code, it’s about collaborating,
reviewing, and maintaining a high-quality, reliable codebase as a team.