Skip to main content

Command Palette

Search for a command to run...

Git Task Report

Published
•2 min read•View as Markdown
Git Task Report
A

SRE with 3 years of experience in cloud computing, infrastructure management, and DevOps tools. Proficient in managing AWS services , DevOps Tools. Hands-on experience with containerization tools like Docker, Kubernetes, and version control with GIT. Adept at optimizing and automating infrastructure, improving CI/CD pipelines, and collaborating within cross-functional teams to deliver high-quality cloud solutions.

Objective:

Perform a series of Git operations involving branch creation, file changes, stashing, and commits to simulate a basic version control workflow.

Tasks Performed:

✅ 1. Created a Git working directory with feature1.txt and feature2.txt in the master branch

  • Initialized a new Git repository.

  • Created feature1.txt and feature2.txt.

  • Added and committed both files to the master branch.

SOLUTION

mkdir git-task
cd git-task
git init
echo "This is feature1 file" > feature1.txt
echo "This is feature2 file" > feature2.txt
git add feature1.txt feature2.txt
git commit -m "Add feature1.txt and feature2.txt to master"

✅ 2. Created 3 branches: develop, feature1, and feature2

  • Switched from master to develop, then created feature1 and feature2 branches.
git branch develop
git branch feature1
git branch feature2

✅ 3. In develop branch, created develop.txt (not staged or committed)

  • Switched to develop branch.

  • Created develop.txt but did not stage or commit the file.

git checkout develop
echo "This is develop file" > develop.txt

✅ 4. Stashed the develop.txt file and checked out to feature1 branch

  • Stashed the uncommitted changes.

  • Switched to the feature1 branch.

  •   git stash
      git checkout feature1
    

✅ 5. Created new.txt file in feature1 branch, staged and committed it

  • Created a new file specific to the feature1 branch.

  • Staged and committed the file.

echo "This is new file in feature1 branch" > new.txt
git add new.txt
git commit -m "Add new.txt in feature1 branch"

✅ 6. Checked out to develop, unstashed the file, and committed

  • Returned to the develop branch.

  • Unstashed the previous changes (develop.txt).

  • Staged and committed the file.

git checkout develop
git stash pop
git add develop.txt
git commit -m "Add develop.txt in develop branch"

✅ Summary:

This task demonstrated a common developer workflow involving:

  • Branching strategy

  • Working with uncommitted changes

  • Stashing and applying changes

  • Managing feature-specific files across branches