#90daysofdevops { Day -8}

Nikhil KathaleNikhil Kathale
4 min read

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:

  1. Repository (Repo) πŸ“:

    • A collection of files and folders along with the entire history of changes. The heart of Git collaboration.
  2. Commit πŸ“:

    • A snapshot of changes made to files, akin to saving a checkpoint in a video game. Captures the essence of progress.
  3. Branch 🌿:

    • A divergent path of development, allowing for experimentation and parallel work without disrupting the main project.
  4. Merge 🀝:

    • The art of combining branches back into the mainline, fostering collaboration and unity.
  5. Pull Request πŸ”„:

    • A proposal to merge changes from one branch to another, a courteous way to invite collaboration.
  6. 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:

  1. git init 🎭 - Initiates the magic, transforming a directory into a Git repository.

  2. git add πŸ”„ - Prepares files for a magical snapshot (commit).

  3. git commit πŸ“ - Captures the essence of changes, creating a checkpoint in the repository's history.

  4. git pull πŸš€ - Summons changes from a remote repository to stay in sync with the collaborative symphony.

  5. 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:

  1. Repositories πŸ“:

    • Collections of code, project files, and collaboration history. The heart of GitHub's community.
  2. Issues πŸ“’:

    • Virtual townhalls for discussions, bug tracking, and feature requests. A space to voice and resolve concerns.
  3. Pull Requests πŸ”„:

    • Invitations for collaboration, proposing changes from a forked repository. The gateway to contribute and merge.
  4. Actions πŸƒβ€β™‚οΈ:

    • Automated workflows to build, test, and deploy code. The backstage crew ensuring seamless performances.
  5. Discussions πŸ’¬:

    • Forums for in-depth conversations, brainstorming, and knowledge sharing. A gathering place for the community.
  6. 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:

  1. πŸš€ git clone - Initiates the journey by bringing a repository to your local machine.

  2. πŸ”„ git pull - Synchronizes your local copy with the collaborative masterpiece.

  3. πŸ“ git commit - Captures your contribution in a snapshot, ready to join the GitHub stage.

  4. πŸš€ git push - Sends your changes to the GitHub repository, sharing your brilliance with the world.

Step 1: Create a New Repository on GitHub

  1. Go to GitHub.

  2. Log in to your account.

  3. Click on the '+' sign in the top right corner and select "New repository."

  4. Fill in the repository name, add a description, and initialize it with a README if you want.

  5. 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

  1. Open a text editor or code editor.

  2. Make changes to an existing file in the repository or create a new file.

  3. 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/

12
Subscribe to my newsletter

Read articles from Nikhil Kathale directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Nikhil Kathale
Nikhil Kathale