#90daysofdevops { Day -8}
Basic Git & GitHub for DevOps Engineers.
π Git: A Symphony of Collaboration and Version Control! π΅
Git is a powerful and versatile distributed version control system, designed to harmonize the collaborative efforts of developers across the digital landscape. π€π»
Key Components:
Repository (Repo) π:
- A collection of files and folders along with the entire history of changes. The heart of Git collaboration.
Commit π:
- A snapshot of changes made to files, akin to saving a checkpoint in a video game. Captures the essence of progress.
Branch πΏ:
- A divergent path of development, allowing for experimentation and parallel work without disrupting the main project.
Merge π€:
- The art of combining branches back into the mainline, fostering collaboration and unity.
Pull Request π:
- A proposal to merge changes from one branch to another, a courteous way to invite collaboration.
Clone π:
- The act of creating a copy of a repository on your local machine, opening doors to contribution and exploration.
Why Git?
Collaboration: Enables seamless teamwork, allowing multiple contributors to work on the same project without conflicts.
History Tracking: Every change is recorded, offering a time-travel-like ability to explore the evolution of a project.
Branching Magic: Empowers developers to experiment, test, and innovate in isolation without affecting the main project.
Distributed Architecture: Ensures redundancy and resilience by providing a local copy of the entire repository on each developer's machine.
Commands and Rituals:
git init
π - Initiates the magic, transforming a directory into a Git repository.git add
π - Prepares files for a magical snapshot (commit).git commit
π - Captures the essence of changes, creating a checkpoint in the repository's history.git pull
π - Summons changes from a remote repository to stay in sync with the collaborative symphony.git push
π - Sends changes to a remote repository, sharing your contributions with the world.
π GitHub: The Social Hub of Code Collaboration! π
GitHub is a web-based platform that transforms the traditional version control system into a vibrant and collaborative experience. π€π»
Key Features:
Repositories π:
- Collections of code, project files, and collaboration history. The heart of GitHub's community.
Issues π’:
- Virtual townhalls for discussions, bug tracking, and feature requests. A space to voice and resolve concerns.
Pull Requests π:
- Invitations for collaboration, proposing changes from a forked repository. The gateway to contribute and merge.
Actions πββοΈ:
- Automated workflows to build, test, and deploy code. The backstage crew ensuring seamless performances.
Discussions π¬:
- Forums for in-depth conversations, brainstorming, and knowledge sharing. A gathering place for the community.
Gists π:
- Snippets of code or text, perfect for sharing small ideas or solutions. A canvas for quick collaboration.
Why GitHub?
Collaboration Playground: Fosters a global community, allowing developers to collaborate on open-source projects.
Visibility and Transparency: Offers a transparent view of project activity, issues, and contributions, promoting openness.
Code Review Nirvana: Facilitates code reviews through pull requests, ensuring quality and fostering improvement.
Project Management Hub: Integrates project management tools, turning GitHub into a one-stop-shop for development.
Embrace the GitHub Dance:
π
git clone
- Initiates the journey by bringing a repository to your local machine.π
git pull
- Synchronizes your local copy with the collaborative masterpiece.π
git commit
- Captures your contribution in a snapshot, ready to join the GitHub stage.π
git push
- Sends your changes to the GitHub repository, sharing your brilliance with the world.
Step 1: Create a New Repository on GitHub
Log in to your account.
Click on the '+' sign in the top right corner and select "New repository."
Fill in the repository name, add a description, and initialize it with a README if you want.
Click on "Create repository."
Step 2: Clone the Repository to Your LocalMachine
Open a terminal on your local machine and run the following commands:
git clone https://github.com/Nikhilkathale741/django-todo-cicd.git
cd devops1
Step 3: Make Changes and Commit
Open a text editor or code editor.
Make changes to an existing file in the repository or create a new file.
Save your changes.
In the terminal:
bashCopy code# Check the status of your changes
git status
git add .
git commit -m "Add descriptive commit message"
Step 4: Push Changes to GitHub
bashCopy code# Push the changes to the GitHub repository
git push origin main
Connect with me on LinkedInππ:https://www.linkedin.com/in/nikhil-kathale-27544a1b5/
Subscribe to my newsletter
Read articles from Nikhil Kathale directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by