#90daysofdevops { Day -9}

Β·

4 min read

#90daysofdevops  { Day -9}

Diving Deep into Git & GitHub for DevOps Mastery

WHHAT THE HECK IS GIT?πŸ¦Έβ€β™‚οΈπŸ’»πŸ¦Έβ€β™‚οΈ

Git is your coding superhero, ensuring an electrifying and collaborative coding journey. πŸš€ With powers to track changes, undo mistakes, and create alternate realities with branching, Git transforms coding chaos into a synchronized dance. πŸ•ΊπŸ’ƒ It's a fortress for your code, inviting collaboration through repositories, while its time-travel capabilities let you revisit any project moment. πŸ°βŒ›οΈ Let Git be your trusty sidekick, making coding not just thrilling but secure and team-friendly! πŸ¦Έβ€β™‚οΈπŸ’»

What is difference Between Main Branch and Master Branch??

The Main Branch is your project's beating heart, where the latest and greatest code thrives. It's like the bustling city center of your code metropolis, where every developer's contribution converges to create coding symphony. πŸ™οΈπŸŽΆ

Now, meet the Master Branch – the maestro orchestrating the show! 🎩✨ Traditionally known as the "Master," it's the branch where the most polished, battle-tested code resides. It's the pinnacle of coding perfection, ruling with elegance and authority. πŸ°πŸ’»

In the world of coding harmony, these branches might play different tunes, but together, they create a dazzling code masterpiece. Whether you prefer the bustling streets of Main or the refined elegance of Master, both branches lead to the epic crescendo of your coding magnum opus! πŸš€πŸŽΈ

What's the difference between Git and GitHub?🌌✨

Git and GitHub are like the dynamic duo of the coding universe, each bringing its own flair to the cosmic dance of version control. 🌌✨

Enter Git, the coding sorcerer! πŸ§™β€β™‚οΈ Git is the magic wand that enables version control, letting you track changes, rewind time, and collaborate seamlessly with fellow wizards. It's your spellbook for crafting the perfect code potion on your local machine. πŸ“œπŸ’»

Now, step onto the intergalactic stage, and there's GitHub, the interstellar party where coders from across the cosmos converge! πŸš€πŸŒŒ GitHub is like the cosmic hub where Git repositories become social, allowing developers to showcase their coding constellations, collaborate with others, and embark on epic coding quests together. It's your spaceship to the stars, making code collaboration an interplanetary adventure. πŸŒ πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

In essence, Git is the enchanting spellcaster on your computer, while GitHub is the pulsating intergalactic party where coders unite to create coding galaxies that sparkle and shine! πŸŽ‰πŸ’«

HOW WE CREATE NEW RERPOSITORY ON GITHUB!

Creating a new repository on GitHub is as exciting as launching a spaceship into the coding cosmos! πŸš€βœ¨ Here's a step-by-step guide:

  1. Navigate to GitHub: Open your browser, go to GitHub, and log in to your account.

  2. Click on the "+" Button: In the top right corner, you'll see a "+" button. Click on it, and a dropdown menu will appear.

  3. Select "New repository": Among the options, choose "New repository." This is where the magic begins!

  4. Fill in the Repository Information:

    • Repository name: Choose a name that reflects your project – this is your code's identity!

    • Description: Provide a brief and captivating description, so others can understand your project's awesomeness.

    • Public or Private: Decide if you want the repository to be public (visible to everyone) or private (restricted access).

  5. Initialize this repository with a README: You can choose to add a README file right away. It's like the welcome mat for your code spaceship, providing essential information about your project.

  6. Choose a .gitignore: If your project involves specific files you don't want to track (like log files or system files), select a template. It's like telling GitHub what to ignore during the coding journey.

  7. Choose a license: Pick a license to let others know how they can use, modify, and share your code. Think of it as the intergalactic law for your coding galaxy.

  8. Click "Create repository": The moment of truth! Hit that button, and watch as GitHub conjures up your new repository.

Voila! You've just launched your coding spaceship into the GitHub galaxy. Now you can start pushing code commits, collaborating with others, and turning your coding dreams into a cosmic reality! πŸŒŒπŸ’»

To Create a Repo -

  1. Create a Repository on GitHub:

    • Log in to your GitHub account.

    • Click on the "+" button in the top right corner.

    • Choose "New repository."

    • Name it "Devops" and add any additional information you want.

    • Click "Create repository."

  2. Connect Your Local Repository to GitHub:

    • Open your terminal.

    • Navigate to the local repository on your machine using the cd command.

    • Run the following commands, replacing <your-username> with your GitHub username and <repository-name> with "Devops":

        bashCopy codegit init
        git add .
        git commit -m "Initial commit"
        git remote add origin https://github.com/<your-username>/Devops.git
        git branch -M main
      
  3. Create a New File inDevops/Git/Day-02.txt:

    • Run the following commands:

        bashCopy codemkdir -p Devops/Git
        touch Devops/Git/Day-02.txt
      
  4. Add Content toDay-02.txt:

    • Open the file in your preferred text editor and add some content.
  5. Commit and Push to GitHub:

    • Run the following commands:

        bashCopy codegit add .
        git commit -m "Add Day-02.txt with content"
        git push -u origin main
      

Now, your local commits, including the new file Day-02.txt with content, should be pushed to the "Devops" repository on GitHub. Check your GitHub repository to confirm the changes! πŸš€πŸ’»

Connect with me on LinkedInπŸ‘”πŸŒ:linkedin.com/in/nikhil-kathale-27544a1b5

Β