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

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

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

Git is a distributed version control system (DVCS) that is widely used in software development and various other fields to track changes to files and coordinate work among multiple contributors. It was created by Linus Torvalds in 2005 and has since become an integral tool for software development. Here's why Git is important:

Git is important because it enables efficient collaboration, tracks code changes, and provides accountability in software development. It simplifies teamwork, preserves code history, and safeguards against errors.

?

  • "Master" Branch: This was the commonly used term for the default branch in Git, where the primary development work took place. However, some users have found the term "master" to be potentially exclusionary, and it has been replaced with more inclusive alternatives.
  • "Main" Branch: Many organizations and projects now use "main" as the default branch name instead of "master." This change in terminology is intended to promote a more inclusive and respectful naming convention.

?

Git is the version control system that handles tracking changes and managing code on a developer's local machine, while GitHub is an online platform that hosts Git repositories, facilitates collaboration, and offers additional project management features. Many developers use Git locally and then push their code to GitHub or similar platforms to collaborate with others and share their work.

?

?

To create a new repository on GitHub:

  1. Sign in to GitHub or sign up for an account.
  2. Click "New" in your GitHub dashboard.
  3. Provide a unique name, optional description, visibility (public or private), and other details for your repository.
  4. Optionally, initialize with a README, add a license, and select a .gitignore file.
  5. Click "Create repository" to create your new repository on GitHub.

?

?

Local Repository:

  1. A local repository is stored on your local machine.
  2. It resides on your computer's hard drive and contains the complete version history and files of your project.
  3. You can work on your project locally and commit changes to the local repository.

Remote Repository (e.g., on GitHub):

  1. A remote repository is hosted on a server or platform like GitHub.
  2. It serves as a central, cloud-based copy of your project and facilitates collaboration among team members.
  3. Multiple developers can access and collaborate on the same project by pushing and pulling changes to and from the remote repository.

To connect a local repository to a remote repository:

  1. Create a remote repository on a hosting platform like GitHub, GitLab, or Bitbucket.
  2. In your local repository, use the git remote add command to link your local repository to the remote repository. For example:

git remote add origin <https://github.com/muhamadkamran674/Blue_Ocean_Pipeline_Jenkins.git>

  1. Push your local repository's content to the remote repository using the git push command. For example:

git push -u origin master

  1. Your local and remote repositories are now connected, allowing you to synchronize changes between them using git push and git pull commands.

#DevOps?#cloud?#CI/CD?#AWS?#90daysofdevops?#DevOpsCulture?#k8?#90DaysOfDevOps

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

Muhamad Kamran的更多文章

社区洞察

其他会员也浏览了