90DaysOfDevOps Challenge - Day 9 - Deep Dive in Git & GitHub for DevOps Engineers

90DaysOfDevOps Challenge - Day 9 - Deep Dive in Git & GitHub for DevOps Engineers

#90daysofdevops - Deep Dive in Git & GitHub-part 2

1.?????Why Git is important?

While talking about Git, the biggest advantage of Git is its branching capabilities. Moreover, it is distributed version control system, which makes it more scalable. All the developers can work from their remote locations and contribute to the same piece of code.


2.?????What is the difference Between Main Branch and Master Branch?

Previously, the name of the default branch of any repository was “master”. But from October 2020 onward, the default branch of any GitHub repository is using “main” as the default branch name, instead of master.


3.?????Can you explain the difference between Git and GitHub?

While Git is a tool that’s used to manage multiple versions of source code edits that are then transferred to files in a Git repository, GitHub is a UI that serves as a location for uploading copies of a Git repository.


In a sense, then, there’s no comparison when it comes to Git vs. GitHub as far as their function.


4.?????What is the difference between local & remote repositories? How to connect locally remotely?


Git local repository is, that will be present inside your local machine.

Git Remote repository is, that where we stored the local repository in our local machines.


Task-1: Set your username and email address, which will be associated with your commits.


> ?To set your username and email address, run “git config --global user.name “Prashant Chaturvedi”” and “git config --global user.email[email protected]””


Task-2:

>?Create a repository named “DevOps” on GitHub.


>?Connect your local repository to the repository on GitHub.


1)????git init: The git init command creates a new Git repository

2)????git status: new file is added which is still untracked

3)????git add . : will add all the files

4)????git status: Changes need to be committed

5)????git commit -m <”adding new file”>

------------------

Prashant Chaturvedi, I'm totally on board with enhancing my version control skills and collaboration capabilities! Could you share a practical example demonstrating the difference between Git and GitHub?

回复

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

社区洞察

其他会员也浏览了