๐Day 9 - Deep Dive in Git & GitHub for DevOps Engineers.

Hey there! ๐
I'm Pratik R. Mandge, a DevOps Engineer passionate about all things AWS DevOps Technology. Currently on a learning adventure, I'm here to share my journey and Blog's in the world of cloud and DevOps.
๐ ๏ธ My focus? Making sense of AWS services, improving CI/CD, and diving into infrastructure as code. Whether you're fellow interns or curious enthusiasts, let's grow together in the vibrant DevOps space.
๐ Connect with me for friendly chats, shared experiences, and learning moments. Here's to embracing the learning curve and thriving in the exciting world of AWS DevOps Technology!
Follow me on LinkedIn: https://www.linkedin.com/in/pratik-mandge363
โ๏ธWhat is Git and why is it important?
Git is a distributed version control system (VCS) that helps developers track changes in their code and collaborate with others on software projects. It was created by Linus Torvalds in 2005 and has since become one of the most widely used version control systems in the software development industry.
It provides a robust and flexible version control system, enabling efficient collaboration, easy code management, and the ability to track changes over time.
โ๏ธWhat is difference Between Main Branch and Master Branch?

In Git, the main or master branch is like the main timeline of your project. It's the default branch where the latest, most stable version of your code lives.
Master Branch:
Older Term: "Master" used to be the common name for this main branch.
Still Used: Many projects still use "master" as the default branch name.
Recognizable: People understand "master" as the main branch in Git.
Main Branch:
Modern Term: "Main" is a newer, more inclusive alternative to "master."
Preferred by Some: Some projects use "main" as the default branch name for a more neutral choice.
GitHub Default: GitHub now uses "main" as the default branch name for new repositories.
โ๏ธDifference between GitHub and Git?

โ๏ธHow do I create a new repository on GitHub?
Creating a new repository on GitHub involves a few simple steps. Here's a step-by-step guide:
Login to GitHub:
Navigate to Your Profile:
Go to Repositories:
- In your profile, find and click on the "Repositories" tab. If you don't have any repositories yet, this section will be empty.
Create a New Repository:
- On the right side of the Repositories page, you'll find a green button labeled "New." Click on it.
Fill in Repository Information:
You'll be taken to a page where you can set up your new repository. Fill in the following information:
Repository name: Choose a name for your repository. This will also be part of your repository's URL.
Description: Add a brief description of your project (optional).
Visibility: Choose whether your repository will be public (visible to everyone) or private (accessible only to you and collaborators).
Initialize this repository with a README: If you want to add a README file (a document providing information about your project), check this box.
Create Repository:
- Click the green "Create repository" button at the bottom of the page.
Congratulations! You've successfully created a new repository on GitHub.
โ๏ธWhat is difference between local & remote repository? How to connect local to remote?
A remote repository is hosted on a remote (this could be on the internet or an off-site server; it could even be the same machine in a different path) and is shared among multiple team members. A local repository is hosted on a local machine for an individual user.
Connecting Local to Remote Repository: To connect your local repository to a remote repository, follow these steps:
Create a Remote Repository:
On the platform of your choice (e.g., GitHub), create a new repository.
Copy the repository URL.
Initialize Local Repository:
Navigate to your local project directory using the command line.
Run the following commands to initialize a Git repository and make an initial commit:
git init git add . git commit -m "Initial commit"
Add Remote Repository URL:
Run the following command, replacing
<remote-url>with the URL you copied earlier:git remote add origin <remote-url>
Push Local Repository to Remote:
Push your local repository to the remote repository:
git push -u origin masterNow, your local repository is connected to the remote repository. You can push changes from local to remote using
git pushand pull changes from remote to local usinggit pull. This setup enables collaboration and version control in a shared environment.
โ๏ธTask-1:
Set your user name and email address, which will be associated with your commits.

โ๏ธTask-2:
โผ๏ธCreate a repository named "Devops" on GitHub.
โผ๏ธConnect your local repository to the repository on GitHub.
git init # Initialize a new Git repository locally (if not already initialized)
git remote add origin https://github.com/your-username/Devops.git
โผ๏ธCreate a new file in Devops/Git/Day-02.txt & add some content to it.
mkdir -p Devops/Git
echo "Hello, this is Day 02 content!" > Devops/Git/Day-02.txt
git add .
git commit -m "Add Day 02 content"
โผ๏ธPush your local commits to the repository on GitHub.
git push -u origin master
โผ๏ธUsername for 'https://github.com': Give your Github Username.
โผ๏ธPassword for 'https://mandgepratik@github.com': Add your Personal Access Token ( PAT ).

โผ๏ธNow, if you visit your GitHub repository (https://github.com/your-username/Devops), you should see the "Day-02.txt" file with the content you added. Your local and remote repositories are now connected, and the changes have been synchronized.๐

โ๏ธConclusion:
Diving into Git and GitHub provides DevOps Engineers with crucial version control and collaboration skills. This journey ensures proficiency in streamlined development workflows, enabling agile coding practices. The exploration promises valuable insights, empowering engineers for efficient project management in the dynamic realm of software development.
I'm glad to hear that you're confident about the value of your blog! If you have any questions or need assistance with anything related to the content, blogging, or any other topic, feel free to ask.๐
๐Happy Learning:) ๐




