Git Mini Project
DevOps Project Series
Hi
I’m starting a DevOps project series, and every week, I will upload a plan for a project focusing on DevOps tools and methodologies.
If you want to learn DevOps, you can work on the projects and gain a lot of insights.
We are starting with Git.
Project: Git Workflow Simulation
Objective
To simulate a real-world Git workflow where you work on a collaborative project, managing branches, commits, merges, and resolving conflicts.
Project Overview
You will create a simple project (a basic script, a Markdown document, or a small app) and follow a structured Git workflow using different commands.
Requirements & Assessment Tasks
- Project Setup
- Initialize a Git repository (
git init
). - Create a remote repository on GitHub/GitLab/Bitbucket.
- Link the remote repo (
git remote add origin <repo-url> or git clone url
). - Create an initial README.md and push the first commit (
git add
,git commit
,git push
).
2. Branching Strategy
- Create a
dev
branch (git branch dev
). - Switch to the
dev
branch (git checkout dev
orgit switch dev
). - Create two feature branches (
feature-1
,feature-2
) offdev
(git checkout -b feature-1
).
3. Working with Commits
- Make multiple commits in
feature-1
andfeature-2
(git commit -m "message"
). - Use
git log
andgit reflog
to track commit history.
4. Merging & Rebasing
- Merge
feature-1
intodev
(git checkout dev
,git merge feature-1
). - Try rebasing
feature-2
on top ofdev
(git rebase dev
). - Resolve merge conflicts if any (
git status
,git diff
,git mergetool
).
5. Stashing & Reset
- Create an uncommitted change and stash it (
git stash
). - Apply the stash (
git stash apply
orgit stash pop
). - Try resetting a commit (
git reset --soft
orgit reset --hard
).
6.Working with Remote Repositories
- Push a feature branch (
git push origin feature-1
). - Fetch latest updates (
git fetch
). - Pull the latest changes (
git pull
). - Work with
git cherry-pick
to pick specific commits.
7. Rewriting History
- Modify commit history using
git commit --amend
. - Squash multiple commits (
git rebase -i HEAD~3
).
8. Tagging & Releases
- Create a version tag (
git tag v1.0
). - Push tags to remote (
git push origin --tags
).
9. Collaboration & PR Simulation
- Fork a repository and clone it.
- Simulate a Pull Request by pushing a branch and merging it via GitHub/GitLab UI.
Deliverabes
- A GitHub repository with all branches.
- A log of commands used and your thoughts on each.
- A report on challenges faced (e.g., conflicts, mistakes) and how you resolved them.
You can update me on your progress, and I can help you troubleshoot issues or suggest improvements. How does this sound? 🚀