Git Basics
beginnergitversion-control
Master version control fundamentals through practical Git operations
← Back to BeginnerLearning Objectives
- Understand Git's distributed version control model
- Learn core Git commands and workflows
- Implement proper branching strategies
- Connect local repositories to remote platforms (GitHub)
- Document code changes with meaningful commit messages
Requirements
You are required to create a local Git repository, connect it to GitHub, and perform the following operations:
- Repository Creation and Setup
- Initialize a repository (
git init) - Configure your identity (
git config --global user.name/user.email) - Create a
README.mdwith a project description
- Initialize a repository (
- Working with Changes
- Create and edit files in your repository
- Check file status (
git status) - Stage changes (
git add) - Commit with meaningful messages following Conventional Commits (
git commit -m "feat: ...")
- Remote Repository Integration
- Create a GitHub repository
- Connect local to remote (
git remote add origin <URL>) - Push local commits to GitHub (
git push -u origin main) - Clone the repository to a different location (
git clone <URL>)
- Branching and Merging
- Create a feature branch (
git checkout -b feature-x) - Make changes on the feature branch
- Merge back to main (
git merge feature-x) - Resolve merge conflicts
- Create a feature branch (
- History and Collaboration
- View commit history (
git log --oneline --graph) - Compare differences (
git diff) - Pull changes from remote (
git pull)
- View commit history (
Stretch Goals
- Add a
.gitignorefor common files (node_modules/,.env,*.log) - Create and merge a pull request on GitHub
- Use
git rebaseto maintain a clean project history - Configure SSH key authentication for GitHub
Deliverables
- A GitHub repository with:
- At least 5 commits showing progression of work
- A feature branch that was merged back into main
- A meaningful
README.md - A properly configured
.gitignore
- Documentation of the commands used and lessons learned
References
- Git Official Documentation
- Pro Git Book (free)
- Conventional Commits
- Interactive Git Branching
- GitHub Guides: Hello World
- Git Cheat Sheet - GitHub
Once you complete this task you will have a solid understanding of Git workflows, branching, and remote collaboration - essential skills for every DevOps engineer and prerequisite for every task that follows.
Submit Your Solution
Completed this project? Share your solution with the community!
- Push your code to a GitHub repository
- Open an issue on our GitHub repo with your solution link
- Share on X with the hashtag #DevOpsDiary
