Day 9 Task: Deep Dive in Git & GitHub for DevOps Engineers.

Day 9 Task: Deep Dive in Git & GitHub for DevOps Engineers.


  1. 1. What is Git and why is it important?Git is a distributed version control system (DVCS) that allows multiple developers to collaborate on a project, tracking changes in source code during software development. It enables teams to work on the same project simultaneously without interfering with each other's work. Git provides features such as branching, merging, and version history, which are crucial for managing and maintaining codebases efficiently. It helps in tracking changes, resolving conflicts, and rolling back to previous versions if needed.2. What is the difference between the Main Branch and the Master Branch?In Git, the term "master" historically referred to the default branch that was created when you initialized a new repository. However, in recent years, there has been a movement towards more inclusive language in the tech industry. Consequently, many projects and platforms, including Git itself, have started using "main" instead of "master" to refer to the default branch. Therefore, "main" is the preferred term, and it is more neutral and inclusive.3. Can you explain the difference between Git and GitHub?Git is a version control system that helps track changes in source code during software development, while GitHub is a web-based platform that provides hosting for software development and collaboration using Git. In other words, Git is the tool, and GitHub is a service that utilizes Git for version control and provides additional collaboration features such as issue tracking, pull requests, and project management. There are other Git hosting services like GitLab and Bitbucket as well.4. How do you create a new repository on GitHub?To create a new repository on GitHub:1. Log in to your GitHub account.2. Click on the "+" sign in the upper-right corner and choose "New repository."3. Fill in the repository name, description, and other options.4. Choose between public and private repository settings.5. Initialize the repository with a README file if needed.6. Click on the "Create repository" button.After creating the repository, you can clone it to your local machine and start working on your project.5. What is the difference between local and remote repositories? How to connect local to remote?- Local Repository: The local repository is the copy of the project that resides on your local machine. It contains the complete project history and all the files.- Remote Repository: The remote repository is hosted on a server, such as GitHub, GitLab, or Bitbucket. It serves as a centralized location for collaboration and backup.To connect a local repository to a remote repository:1. On GitHub, create a new repository (if not already created).2. On your local machine, navigate to your project directory using the command line.3. Use the following commands:

   git init  # Initializes a new Git repository locally (if not already done).        
   git add . # Adds all files to the staging area.        
   git commit -m "Initial commit"  # Commits the changes.        
   git remote add origin <repository_url>  # Adds a remote repository.        
   git push -u origin main  # Pushes the changes to the remote repository (replace "main" with the branch name if different).        

Now, your local repository is connected to the remote repository on GitHub. You can push and pull changes between the local and remote repositories as needed.

nClouds #90daysDevops #challange #Git&github

Tasks

task-1:

  • Set your user name and email address, which will be associated with your commits.Certainly! To set your user name and email address in Git, you can use the following commands in your command line or terminal:

git config --global user.name "Your Name"        
git config --global user.email "[email protected]"        

Replace "Your Name" with your actual name and "[email protected]" with your actual email address. The --global flag ensures that these settings are applied globally to all your Git repositories on the machine. If you want to set them only for a specific repository, you can omit the --global flag and run these commands within the repository.

  • These settings are important because they associate your identity with the commits you make in Git, providing information about who made a particular change in the version history of your project.


要查看或添加评论,请登录

Harpreet kaur的更多文章

  • Git hub

    Git hub

    GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on…

  • Day 10 Task: Advance Git & GitHub for DevOps Engineers.

    Day 10 Task: Advance Git & GitHub for DevOps Engineers.

    Git Branching Git branching is a powerful feature that allows developers to work on different parts of a project…

  • Day 10 Task: Advance Git & GitHub for DevOps Engineers.

    Day 10 Task: Advance Git & GitHub for DevOps Engineers.

    and are two different Git commands used to integrate changes from one branch into another. They have distinct workflows…

  • Day 10 Task: Advance Git & GitHub for DevOps Engineers.

    Day 10 Task: Advance Git & GitHub for DevOps Engineers.

    Git provides two different commands, and , that are used to undo changes in a repository, but they serve different…

  • Git

    Git

    Debian/Ubuntu For the latest stable version for your release of Debian/Ubuntu For Ubuntu, this PPA provides the latest…

  • #DAY08 #90DAYS WITH DEVOPS

    #DAY08 #90DAYS WITH DEVOPS

    Git: Git is a distributed version control system (DVCS) designed to handle everything from small to very large projects…

  • #Day07

    #Day07

    A package manager in Linux is a tool or software application that helps users and administrators install, update…

    1 条评论
  • INSTALL DOCKER

    INSTALL DOCKER

    #day07 of #90days devops challange Docker is an application that simplifies the process of managing application…

  • File Permissions and Access Control Lists

    File Permissions and Access Control Lists

    #day6 #90daysdevops CHMOD: Chmod is used to change file permission. There are two ways to change the permissions of a…

  • User Management in Linux #day5

    User Management in Linux #day5

    Linux operating system, that can manipulate files and perform several other operations. Each user is assigned an ID…

    2 条评论

社区洞察

其他会员也浏览了