Merge branch 'main' of https://github.com/subineru/90DaysOfDevOps
This commit is contained in:
commit
c698e367fa
@ -17,7 +17,7 @@ To be successful in DevOps you have to have a good knowledge of programming skil
|
||||
|
||||
## Understand why you need to learn a programming language.
|
||||
|
||||
The reason that Python and Go are recommended so often for DevOps engineers is that a lot of the DevOps tooling is written in either Python or Go, which makes sense if you are going be build DevOps tools. Now this is important as this will determine really what you should learn and that would likely be the most beneficial. If you are going to be building DevOps tools or you are joining a team that does then it would make sense to learn that same language, if you are going to be heavily involved in Kubernetes or Containers then it's more than likely that you would want to choose Go as your programming language. For me, the company I work for (Kasten by Veeam) is in the Cloud-Native ecosystem focused on data management for Kubernetes and everything is written in Go.
|
||||
The reason that Python and Go are recommended so often for DevOps engineers is that a lot of the DevOps tooling is written in either Python or Go, which makes sense if you are going to be building DevOps tools. Now this is important as this will determine really what you should learn and that would likely be the most beneficial. If you are going to be building DevOps tools or you are joining a team that does then it would make sense to learn that same language, if you are going to be heavily involved in Kubernetes or Containers then it's more than likely that you would want to choose Go as your programming language. For me, the company I work for (Kasten by Veeam) is in the Cloud-Native ecosystem focused on data management for Kubernetes and everything is written in Go.
|
||||
|
||||
But then you might not have clear cut reasoning like that to choose you might be a student or transitioning careers with no real decision made for you. I think in this situation then you should choose the one that seems to resonate and fit with the applications you are looking to work with.
|
||||
|
||||
|
@ -86,10 +86,12 @@ go build main.go
|
||||
```
|
||||

|
||||
|
||||
If we run that
|
||||
|
||||

|
||||
If we run that, we would see the same output:
|
||||
|
||||
```bash
|
||||
$ ./main.exe
|
||||
Hello #90DaysOfDevOps
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
title: '#90DaysOfDevOps - Alternatives to Docker - Day 48'
|
||||
published: false
|
||||
description: 90DaysOfDevOps - Alternatives to Docker
|
||||
tags: "devops, 90daysofdevops, learning"
|
||||
tags: 'devops, 90daysofdevops, learning'
|
||||
cover_image: null
|
||||
canonical_url: null
|
||||
id: 1048807
|
||||
@ -113,7 +113,6 @@ We could also mention toolings and options around Rancher, VirtualBox but we can
|
||||
- [YAML Tutorial: Everything You Need to Get Started in Minute](https://www.cloudbees.com/blog/yaml-tutorial-everything-you-need-get-started)
|
||||
- [Podman | Daemonless Docker | Getting Started with Podman](https://www.youtube.com/watch?v=Za2BqzeZjBk)
|
||||
- [LXC - Guide to building a LXC Lab](https://www.youtube.com/watch?v=cqOtksmsxfg)
|
||||
-
|
||||
|
||||
|
||||
See you on [Day 49](day49.md)
|
||||
|
@ -209,7 +209,7 @@ A Pod is a group of containers that form a logical application. For e.g. If you
|
||||
|
||||
- a unified way to route traffic to a cluster and eventually to a list of Pods.
|
||||
|
||||
- By using a Service, Pods can be brought up and down without affecting anything..
|
||||
- By using a Service, Pods can be brought up and down without affecting anything.
|
||||
|
||||
This is just a quick overview and notes around the fundamental building blocks of Kubernetes, we can take this knowledge and add in some other areas around Storage and Ingress to enhance our applications but we then also have a lot of choices on where our Kubernetes cluster runs. The next session will focus on those options on where can I run a Kubernetes cluster, whilst also exploring some specifics around Storage.
|
||||
|
||||
|
@ -9,46 +9,63 @@ id: 1048731
|
||||
---
|
||||
## 简介 - Day 1
|
||||
|
||||
Day 1 of our 90 days and adventure to learn a good foundational understanding of DevOps and tools that help with a DevOps mindset.
|
||||
在90天中的第一天,我们开始学习DevOps的基本理解和工具。这些可以有助于建立DevOps的思维方式。
|
||||
<!-- Day 1 of our 90 days and adventure to learn a good foundational understanding of DevOps and tools that help with a DevOps mindset. -->
|
||||
|
||||
This learning journey started for me a few years back but my focus then was around virtualisation platforms and cloud based technologies, I was looking mostly into Infrastructure as Code and Application configuration management with Terraform and Chef.
|
||||
几年前,我开始学习相关内容,但我的关注于虚拟化平台和基于云的技术,主要研究基础设施即代码 (Infrastructure as Code, [IaC](https://www.ibm.com/cloud/learn/infrastructure-as-code)) 和Terraform和Chef的应用程序配置管理。
|
||||
<!-- This learning journey started for me a few years back but my focus then was around virtualisation platforms and cloud based technologies, I was looking mostly into Infrastructure as Code and Application configuration management with Terraform and Chef. -->
|
||||
|
||||
Fast forward to March 2021, I was given an amazing opportunity to concentrate my efforts around the Cloud Native strategy at Kasten by Veeam. Which was going to be a massive focus on Kubernetes and DevOps and the community surrounding these technologies. I started my learning journey and quickly realised there was a very wide world aside from just learning the fundamentals of Kubernetes and Containerisation and it was then when I started speaking to the community and learning more and more about the DevOps culture, tooling and processes so I started documenting some of the areas I wanted to learn in public.
|
||||
接着来到2021年3月,我得到了一个可以将精力集中在Veeam的Kasten的云原生部署上的机会。这个项目专注于Kubernetes和DepOps以及相关的社区。在开始学习后,我很快发现在除了Kubernetes和容器化的基础知识,那里还有一个非常广阔的世界。我开始在社区中交流学习更多关于DevOps文化、工具和流程,最终我想公开地分享这些想法。
|
||||
<!-- Fast forward to March 2021, I was given an amazing opportunity to concentrate my efforts around the Cloud Native strategy at Kasten by Veeam. Which was going to be a massive focus on Kubernetes and DevOps and the community surrounding these technologies. I started my learning journey and quickly realised there was a very wide world aside from just learning the fundamentals of Kubernetes and Containerisation and it was then when I started speaking to the community and learning more and more about the DevOps culture, tooling and processes so I started documenting some of the areas I wanted to learn in public. -->
|
||||
|
||||
[So you want to learn DevOps?](https://blog.kasten.io/devops-learning-curve)
|
||||
|
||||
## 开始我们的旅程吧
|
||||
|
||||
If you read the above blog you will see this is a high level contents for my learning journey and I will say at this point I am no where near an expert in any of these sections but what I wanted to do was share some resources both FREE and some paid for but an option for both as we all have different circumstances.
|
||||
如果你阅读了以上的博客,你会发现这是我学习过程中的进阶内容。我认为我并不是以上以上任一领域的专家,但我希望分享一些免费和需付费的资源,我们可以按需选择。
|
||||
<!-- If you read the above blog you will see this is a high level contents for my learning journey and I will say at this point I am no where near an expert in any of these sections but what I wanted to do was share some resources both FREE and some paid for but an option for both as we all have different circumstances. -->
|
||||
|
||||
Over the next 90 days I want to document these resources and cover those foundational areas, I would love for the community to also get involved share your journey and resources so we can learn in public and help each other.
|
||||
在接下来的90天里,我想记录这些资料并涵盖那些基础领域。我希望社区参与进来,分享你的相关经历和资源,以便我们一起学习共同进步。
|
||||
<!-- Over the next 90 days I want to document these resources and cover those foundational areas, I would love for the community to also get involved share your journey and resources so we can learn in public and help each other. -->
|
||||
|
||||
You will see from the opening readme in the project repository that I have split things into sections and it is basically 12 weeks plus 6 days. The first 6 days we will explore the fundamentals of DevOps in general before diving into some of the specific areas, by no way is this list exhaustive and again would love for the community to assist in making this a useful resource.
|
||||
在该项目开头的README中,你会了解到我已经将内容拆分成多个小节,基本上是由12周加6天组成。前6天,我们会大致探讨DevOps的基础,后续再深入到一些特定领域。这份清单不是完美的,再次希望社区参与进来并一起帮助它成为有用的资源。
|
||||
<!-- You will see from the opening readme in the project repository that I have split things into sections and it is basically 12 weeks plus 6 days. The first 6 days we will explore the fundamentals of DevOps in general before diving into some of the specific areas, by no way is this list exhaustive and again would love for the community to assist in making this a useful resource. -->
|
||||
|
||||
Another resource I will share at this point that I think everyone should have a good look at and maybe create your own mind map for yourself and your interest and position is the following:
|
||||
在这里我会分享另一个资源,我认为每个人都应认真了解,或是根据自身需求制作自己的思维导图,它的地址如下:
|
||||
<!-- Another resource I will share at this point that I think everyone should have a good look at and maybe create your own mind map for yourself and your interest and position is the following: -->
|
||||
|
||||
[DevOps Roadmap](https://roadmap.sh/devops)
|
||||
|
||||
I found this a great resource when I was creating my initial list and blog post on this topic. You can also see there are other areas that go into a lot more detail outside of the 12 topics I have listed here in this repository.
|
||||
当我在创建这个初始清单和博客的时候,我发现这是个很好的资源。你也可以看到除了在我列出的12个专题以外的,其他领域更详细的信息。
|
||||
<!-- I found this a great resource when I was creating my initial list and blog post on this topic. You can also see there are other areas that go into a lot more detail outside of the 12 topics I have listed here in this repository. -->
|
||||
|
||||
## 第一步 - 什么是 DevOps?
|
||||
|
||||
There are so many blog articles and YouTube videos to list here, but as we start the 90 day challenge and we focus on spending around an hour a day learning something new or about DevOps I thought it was good to get some of the high level of "what DevOps is" down to begin.
|
||||
这里可以列出很多的博客和YouTube视频,但作为90天挑战的开始,以及我们每天花费约一小时来学习一些新的或关于DevOps的东西。我觉得从宏观的“什么是DevOps”开始是个不错的选择。
|
||||
<!-- There are so many blog articles and YouTube videos to list here, but as we start the 90 day challenge and we focus on spending around an hour a day learning something new or about DevOps I thought it was good to get some of the high level of "what DevOps is" down to begin. -->
|
||||
|
||||
Firstly, DevOps is not a tool. You cannot buy it, it is not a software sku or an open source GitHub repository you can download. It is also not a programming language, it is also not some dark art magic either.
|
||||
首先,DevOps不是工具。你不能购买它,它不是可下载的软件sku或开源GitHub仓库。DevOps也不是编程语言或什么黑魔法。
|
||||
<!-- Firstly, DevOps is not a tool. You cannot buy it, it is not a software sku or an open source GitHub repository you can download. It is also not a programming language, it is also not some dark art magic either. -->
|
||||
|
||||
DevOps is a way to do smarter things in Software Development. - Hold up... But if you are not a software developer should you turn away right now and not dive into this project??? No Not at all, Stay... Because DevOps brings together a combination of software development and operations. I mentioned earlier that I was more on the VM side and that would generally fall under the Operations side of the house, but within the community there are people with all different backgrounds where DevOps is 100% going to benefit the individual, Developers, Operations and QA Engineers all can equally learn these best practices by having a better understanding of DevOps.
|
||||
DevOps是一种在软件开发中更明智的做事方式。- 等一下... 但如果你不是一个软件开发人员,你现在应该关闭这个页面并离开吗??不,继续读下去... 因为DevOps将软件开发和运维运营结合在了一起。我先前提及到,我更多关注的是虚拟机方面的工作,而这些通常属于运营。但在社区中,不同背景的人们都可以通过更好地了解DevOps来学习那些实践案例。DevOps将100%造福于个人、开发者、运维运营和QA工程师。
|
||||
<!-- DevOps is a way to do smarter things in Software Development. - Hold up... But if you are not a software developer should you turn away right now and not dive into this project??? No Not at all, Stay... Because DevOps brings together a combination of software development and operations. I mentioned earlier that I was more on the VM side and that would generally fall under the Operations side of the house, but within the community there are people with all different backgrounds where DevOps is 100% going to benefit the individual, Developers, Operations and QA Engineers all can equally learn these best practices by having a better understanding of DevOps. -->
|
||||
|
||||
DevOps is a set of practices that help to reach the goal of this movement: reducing the time between the ideation phase of a product and its release in production to the end-user or whomever it could be an internal team or customer.
|
||||
DevOps是一系列有助于达成这一目标的实践:减少产品从构思到发布阶段,到最终用户或内部团队或客户的任何人所需要的时间。
|
||||
<!-- DevOps is a set of practices that help to reach the goal of this movement: reducing the time between the ideation phase of a product and its release in production to the end-user or whomever it could be an internal team or customer. -->
|
||||
|
||||
Another area we will dive into in this first week is around **The Agile Methodology** DevOps and Agile are widely adopted together to achieve continuous delivery of your **Application**
|
||||
在这第一个星期,我们将展开讨论**敏捷方法论**(The Agile Methodology)。DevOps和Agile是被广泛使用的方法,为的是实现**应用程序app**的持续迭代更新。
|
||||
<!-- Another area we will dive into in this first week is around **The Agile Methodology** DevOps and Agile are widely adopted together to achieve continuous delivery of your **Application** -->
|
||||
|
||||
The high level take away is with a DevOps mindset or culture its about taking a way the long drawn out software release process from potentially years to being able to drop smaller releases more frequently. The other key fundamental to take away here is it's about breaking down silos between the teams I previously mentioned, Developers, Operations and QA.
|
||||
宏观层次的收获是,DevOps的思维方式是将漫长的软件发布过程从可能几年的时间拆分成更频繁的、较小的多次发布。另一个关键点是,DevOps打破了团队间的隔阂:开发人员、运维运营人员和QA工程师。
|
||||
<!-- The high level take away is with a DevOps mindset or culture its about taking a way the long drawn out software release process from potentially years to being able to drop smaller releases more frequently. The other key fundamental to take away here is it's about breaking down silos between the teams I previously mentioned, Developers, Operations and QA. -->
|
||||
|
||||
From a DevOps perspective, **Development, Testing and Deployment** all land with the DevOps team.
|
||||
从DevOps的角度,**开发、测试、部署**都属于DevOps团队。
|
||||
<!-- From a DevOps perspective, **Development, Testing and Deployment** all land with the DevOps team. -->
|
||||
|
||||
The final point I will make is to make this as effective and efficient as possible we must leverage **Automation**
|
||||
最后一点,我们必须通过**自动化**使得整个过程尽可能有效和高效。
|
||||
<!-- The final point I will make is to make this as effective and efficient as possible we must leverage **Automation** -->
|
||||
|
||||
<!-- ## 信息来源 -->
|
||||
## Resources
|
||||
|
||||
I am always open to adding additional resources to these readme files as it is here as a learning tool.
|
||||
|
@ -8,56 +8,60 @@ canonical_url: null
|
||||
id: 1048731
|
||||
date: '2022-04-17T10:12:40Z'
|
||||
---
|
||||
## Introduction - Day 1
|
||||
## 介紹 - Day 1
|
||||
|
||||
Day 1 of our 90 days and adventure to learn a good foundational understanding of DevOps and tools that help with a DevOps mindset.
|
||||
在90天旅途的第1天,學習基本的DevOps和工具可以幫助我們建立基本的心境
|
||||
|
||||
This learning journey started for me a few years back but my focus then was around virtualisation platforms and cloud based technologies, I was looking mostly into Infrastructure as Code and Application configuration management with Terraform and Chef.
|
||||
這趟學習旅程開始於我幾年前專注在虛擬化和雲平台相關的技術,我當時主要使用 Terraform 和 Chef 研究 Infrastructure as Code 和 Application configuration management
|
||||
|
||||
Fast forward to March 2021, I was given an amazing opportunity to concentrate my efforts around the Cloud Native strategy at Kasten by Veeam. Which was going to be a massive focus on Kubernetes and DevOps and the community surrounding these technologies. I started my learning journey and quickly realised there was a very wide world aside from just learning the fundamentals of Kubernetes and Containerisation and it was then when I started speaking to the community and learning more and more about the DevOps culture, tooling and processes so I started documenting some of the areas I wanted to learn in public.
|
||||
時間快轉到2021 3月,Veeam 為我提供了一個絕佳的機會讓我能將精力專注於Kasten的Cloud Native strategy。也因為如此我花了很大的時間在 Kubernetes 和 DevOps 及圍繞這些技術的社群上。我開始了我的學習之旅,並很快意識到除了學習 Kubernetes 和容器化的基礎知識之外,還有一個非常廣闊的世界,那時我開始與社群交流並越來越瞭解 DevOps 文化、工具和流程,所以我開始公開紀錄一些我想學的領域。
|
||||
|
||||
[So you want to learn DevOps?](https://blog.kasten.io/devops-learning-curve)
|
||||
[想學DevOps?(英文)](https://blog.kasten.io/devops-learning-curve)
|
||||
|
||||
## Let the journey begin
|
||||
## 讓旅途開始吧!
|
||||
|
||||
If you read the above blog, you will see this is a high level contents for my learning journey and I will say at this point I am no where near an expert in any of these sections but what I wanted to do was share some resources both FREE and some paid for but an option for both as we all have different circumstances.
|
||||
如果你讀了上面的Blog,你會發現這是我學習之旅裡的高品質內容,我會說在這些領域都不是專家,但我想做的是分享一些免費和付費資源,你可以自由選擇,因為我們都有不同的情況。
|
||||
|
||||
Over the next 90 days I want to document these resources and cover those foundational areas. I would love for the community to also get involved. Share your journey and resources so we can learn in public and help each other.
|
||||
在接下來的 90 天裡,我想記錄這些資源並涵蓋不同領域的基礎。 我希望社群也能參與其中。 分享你的旅程和資源,以便我們可以公開學習並互相幫助彼此。
|
||||
|
||||
You will see from the opening readme in the project repository that I have split things into sections and it is basically 12 weeks plus 6 days. The first 6 days we will explore the fundamentals of DevOps in general before diving into some of the specific areas. By no way is this list exhaustive and again,I would love for the community to assist in making this a useful resource.
|
||||
從repo中的readme中可以看到,我將內容拆分為多個部分,基本上是 12 週加 6 天。前 6 天,我們將大致探討 DevOps 的基礎知識,然後再深入一些特定領域。 這份清單絕不是詳盡無遺的,我希望社群能夠協助使其成為有用的資源。
|
||||
|
||||
Another resource I will share at this point and that I think everyone should have a good look at, maybe create your own mind map for yourself and your interest and position, is the following:
|
||||
另外一個我想分享的資源,這能幫助你拓展你有興趣的部分並找到自己的定位:
|
||||
|
||||
[DevOps Roadmap](https://roadmap.sh/devops)
|
||||
[DevOps 路線圖](https://roadmap.sh/devops)
|
||||
|
||||
I found this a great resource when I was creating my initial list and blog post on this topic. You can also see there are other areas that go into a lot more detail outside of the 12 topics I have listed here in this repository.
|
||||
當我開始建立關於這個主題相關的列表和Blog時,我發現這是一個很好的資源。你還可以看到,除了我在這份repo中列出的 12 個主題之外,還有其他更詳細的領域。
|
||||
|
||||
## First Steps - What is DevOps?
|
||||
## 第一步 - 何謂DevOps?
|
||||
|
||||
There are so many blog articles and YouTube videos to list here, but as we start the 90 day challenge and we focus on spending around an hour a day learning something new or about DevOps, I thought it was good to get some of the high level of "what DevOps is" down to begin.
|
||||
有很多Blog和YouTube影片在探討關於DevOps,但是當我們開始 90 天挑戰時,我們得專注於每天花大約一個小時學習新的東西或關於 DevOps,我認為獲得一些高品質的東西是件好事,而我們將從"什麼是 DevOps"開始。
|
||||
|
||||
Firstly, DevOps is not a tool. You cannot buy it, it is not a software sku or an open source GitHub repository you can download. It is also not a programming language, it is also not some dark art magic either.
|
||||
首先,DevOps 不是一種工具。 你不能買它,它不是你可以下載的軟體 sku 或開源 GitHub repo。 它也不是一種程式語言,更不是什麼黑魔法。
|
||||
|
||||
DevOps is a way to do smarter things in Software Development. - Hold up... But if you are not a software developer should you turn away right now and not dive into this project??? No. Not at all. Stay... Because DevOps brings together a combination of software development and operations. I mentioned earlier that I was more on the VM side and that would generally fall under the Operations side of the house, but within the community there are people with all different backgrounds where DevOps is 100% going to benefit the individual, Developers, Operations and QA Engineers all can equally learn these best practices by having a better understanding of DevOps.
|
||||
DevOps 是一種在軟體開發中更聰明的做事情的方法。 - 但休但幾勒……如果你不是軟體開發人員,你不是應該現在就轉身離開而不是深入研究這個項目嗎?
|
||||
一點都不。 留下來,因為 DevOps 將軟體開發和運營結合在一起。
|
||||
我之前提過,我主要研究在虛擬機相關的技能,這通常屬於運營方面,但在DevOps社群中,有不同背景的人,DevOps 將 100% 造福於個人、開發人員、運營和 QA 工程師都可以通過更好地了解 DevOps 來學習這些最佳實踐。
|
||||
|
||||
DevOps is a set of practices that help to reach the goal of this movement: reducing the time between the ideation phase of a product and its release in production to the end-user or whomever it could be an internal team or customer.
|
||||
DevOps 是一組幫助達成目標的實踐方法:減少產品的構思階段和產品發佈到最終用戶或任何可能是內部團隊或客戶的人之間的時間。
|
||||
|
||||
我們將在第一週深入探討的另一個領域是**敏捷開發**。 DevOps 和敏捷一起被廣泛採用,以實現您的**應用程序**的持續交付。
|
||||
|
||||
Another area we will dive into in this first week is around **The Agile Methodology**. DevOps and Agile are widely adopted together to achieve continuous delivery of your **Application**.
|
||||
從較高層次的方面來解讀,DevOps 想塑造的情境是將可能數年冗長的軟體發佈週期,縮短至更平凡而較小的版本變動。
|
||||
而另一個關鍵點是 DevOps 工程師有責任打破我之前提到的團隊之間的隔閡:開發人員、運維人員和 QA。
|
||||
|
||||
The high level take away is that a DevOps mindset or culture is about shrinking the long, drawn out software release process from potentially years to being able to drop smaller releases more frequently. The other key fundamental point to understand here is the the responsibility of a DevOps engineer to break down silos between the teams I previously mentioned: Developers, Operations and QA.
|
||||
|
||||
From a DevOps perspective, **Development, Testing and Deployment** all land with the DevOps team.
|
||||
從 DevOps 的角度來看,**開發、測試和部署**都屬於 DevOps 團隊。
|
||||
|
||||
The final point I will make is to make this as effective and efficient as possible we must leverage **Automation**.
|
||||
最後我想說的是,我們必須利用 **自動化** 使其盡可能有效和高效。
|
||||
|
||||
## Resources
|
||||
## 資源
|
||||
|
||||
I am always open to adding additional resources to these readme files as it is here as a learning tool.
|
||||
我把這份readme當作一個學習工具,並且保持開放的心態希望能新增更多的資源
|
||||
|
||||
My advice is to watch all of the below and hopefully you have also picked something up from the text and explanations above.
|
||||
我建議看完下列的影片,希望你能從中學到一些基本的名詞
|
||||
|
||||
- [DevOps in 5 Minutes](https://www.youtube.com/watch?v=Xrgk023l4lI)
|
||||
- [What is DevOps? Easy Way](https://www.youtube.com/watch?v=_Gpe1Zn-1fE&t=43s)
|
||||
- [DevOps roadmap 2022 | Success Roadmap 2022](https://www.youtube.com/watch?v=7l_n97Mt0ko)
|
||||
|
||||
If you made it this far, then you will know if this is where you want to be or not. See you on [Day 2](day02.md).
|
||||
如果你已經看到這裡了, 那你大概會知道你想不想學習DevOps. 我們[Day 2](day02.md)見.
|
||||
|
@ -2,116 +2,116 @@
|
||||
title: '#90DaysOfDevOps - 概述: Git - 版本控制 - 第 35 天'
|
||||
published: false
|
||||
description: 90DaysOfDevOps - 概述 Git - 版本控制
|
||||
tags: 'devops, 90daysofdevops, learning'
|
||||
tags: 'devops,90daysofdevops,learning'
|
||||
cover_image: null
|
||||
canonical_url: null
|
||||
id: 1049041
|
||||
---
|
||||
## 概述: Git - 版本控制
|
||||
|
||||
在開始 Git 工具之前, 我們需要瞭解什麼是版本控制,還有為什麼要使用它. 作為 Git 教學的開端, 我們會稍微帶過何謂版本控制以及 Git 基礎概念.
|
||||
在開始 Git 工具之前,我們需要瞭解什麼是版本控制,還有為什麼要使用它。作為 Git 教學的開端,我們會稍微帶過何謂版本控制以及 Git 基礎概念。
|
||||
|
||||
### 甚麼是版本控制?
|
||||
|
||||
由於 Git 並不是唯一的版本控制工具,所以這一節將會涵蓋版本控制有哪些選項和使用方法.
|
||||
由於 Git 並不是唯一的版本控制工具,所以這一節將會涵蓋版本控制有哪些選項和使用方法。
|
||||
|
||||
版本控制最明顯且重要的功能是可以追蹤專案的歷史. 我們可以利用`git log` 指令回顧儲存庫(repository)內,過去專案提交的紀錄和註解. 讓我們想想, 如果這是實際的軟體專案, 有滿滿的原始碼, 而且許多開發者在不同的時間點提交軟體, 不同的作者和審稿人在這裡做紀錄, 有了歷史追蹤, 我們得以知道發生了什麼事, 何時發生, 又是誰在審稿.
|
||||
版本控制最明顯且重要的功能是可以追蹤專案的歷史。我們可以利用`git log` 指令回顧儲存庫(repository)內,過去專案提交的紀錄和註解。 讓我們想想,如果這是實際的軟體專案,有滿滿的原始碼,而且許多開發者在不同的時間點提交軟體,不同的作者和審稿人在這裡做紀錄,有了歷史追蹤,我們得以知道發生了什麼事,何時發生,又是誰在審稿。
|
||||
|
||||

|
||||
|
||||
版本控制很酷, 就像你在異動程式碼前, 手動複製一份. 你可能會為了以防萬一, 註解掉無用的舊程式碼, 而你隨時可以還原.
|
||||
版本控制很酷,就像你在異動程式碼前,手動複製一份。 你可能會為了以防萬一,註解掉無用的舊程式碼,而你隨時可以還原。
|
||||
|
||||

|
||||
|
||||
我不僅對原始碼做版本控制, 甚至是幾乎對所有的東西做版本控制, 就像談到 90DaysOfDevOps 這個專案, 當你不小心刪到你想要的文字, 難道說不會想要擁有歷史紀錄和做資料回朔的機制?
|
||||
我不僅對原始碼做版本控制,甚至是幾乎對所有的東西做版本控制,就像談到 90DaysOfDevOps 這個專案,當你不小心刪到你想要的文字,難道不會想要擁有歷史紀錄和做資料回朔的機制?
|
||||
|
||||
然而, 在此聲明 **版本控制不是備份!**
|
||||
然而,在此聲明 **版本控制不是備份!**
|
||||
|
||||
版本控制的另外一個好處是它可以對一個專案同時管理很多個版本, 舉一個例子, 我們分別有一個免費版(FREE)和付費版(PAID)的程式, 兩者都能在所有的作業系統上面執行, 而且共享大部分的程式碼, 每次提交程式碼的時候, 都會複製並貼上到其他程式. 這樣做是不是會非常混亂, 尤其是當程式開發不只一個人的時候, 更容易發生錯誤.
|
||||
版本控制的另外一個好處是它可以對一個專案同時管理很多個版本,舉一個例子,我們分別有一個免費版(FREE)和付費版(PAID)的程式,兩者都能在所有的作業系統上面執行,而且共享大部分的程式碼,每次提交程式碼的時候,都會複製並貼上到其他程式。 這樣做是不是會非常混亂,尤其是當程式開發不只一個人的時候,更容易發生錯誤。
|
||||
|
||||
白金方案(Premium)的軟體擁有額外的功能, 在這裡我們稱為 premium commits, 免費版只包含 normal commits.
|
||||
白金方案(Premium)的軟體擁有額外的功能,在這裡我們稱為 premium commits,免費版只包含 normal commits。
|
||||
|
||||
在版本控制中, 想要處理上述的問題需要透過分支(Branching).
|
||||
在版本控制中,想要處理上述的問題需要透過分支(Branching)。
|
||||
|
||||

|
||||
|
||||
如上所述, 分支(Branching) 允許同一支程式擁有兩個程式碼分流. 當我們想要把免費版本的額外功能變成白金付費方案的時候, 我們會透過合併(merging).
|
||||
如上所述,分支(Branching) 允許同一支程式擁有兩個程式碼分流。當我們想要把免費版本的額外功能變成白金付費方案的時候,我們會透過合併(merging)。
|
||||
|
||||

|
||||
|
||||
現在, 合併(merging) 既可以簡單但也可以複雜, 譬如說你有一個團隊在開發免費版, 另一個團隊在開發白金付費版, 兩個團隊同時改動會影響整個程式碼的代碼, 又或只是更新了某個變數導致破壞某樣功能. 版本控制無法解決上述的衝突, 但是讓你更容易更輕鬆的管理.
|
||||
現在,合併(merging) 既可以簡單但也可以複雜,譬如說你有一個團隊在開發免費版,另一個團隊在開發白金付費版,兩個團隊同時改動會影響整個程式碼的代碼,又或只是更新了某個變數導致破壞某樣功能。版本控制無法解決上述的衝突,但是讓你更容易更輕鬆的管理。
|
||||
|
||||
目前為止, 我看到沒有使用版本控制的主要理由就是開發者間的協調能力夠好. 但是有越來越多的案例, 開發者之間正在用版本控制來分享程式碼, 可能是你和你的同事加入一個簡報, 或是你加入一個社群, 對一個項目共向修正和更新, 就像這個儲存庫 90DaysOfDevOps.
|
||||
目前為止,我看到沒有使用版本控制的主要理由就是開發者間的協調能力夠好。但是有越來越多的案例,開發者之間正在用版本控制來分享程式碼,可能是你和你的同事加入一個簡報,或是你加入一個社群,對一個項目共向修正和更新,就像這個儲存庫 90DaysOfDevOps。
|
||||
|
||||
我無法想像軟體開發團隊在沒有版本控制的情況下要怎麼處理問題? 當在我追蹤我自己的項目時, 我就發現他已經夠難了. 我希望團隊們能先把程式碼拆分一小部分的函數, 解決每一小部分函數的問題之後再予與發佈, 事情將簡單的多.
|
||||
我無法想像軟體開發團隊在沒有版本控制的情況下要怎麼處理問題?當在我追蹤我自己的項目時,我就發現他已經夠難了。 我希望團隊們能先把程式碼拆分一小部分的函數,解決每一小部分函數的問題之後再予與發佈,事情將簡單的多。
|
||||
|
||||
也就是說, 有了版本控制, 才有辦法做統整. 像是團隊們正在對不同的模組上進行開發, 這時就能夠協同合作的更好.
|
||||
也就是說,有了版本控制,才有辦法做統整。 像是團隊們正在對不同的模組上進行開發,這時就能夠協同合作的更好。
|
||||
|
||||

|
||||
|
||||
另外值得一提的事情是版本控制不只僅受益於開發者, 團隊中的所有成員和其他工具也都有了能見度, 一些專案管理工具可以跟 git 建立鏈結, 跟蹤工作的狀況. 最知名的例子就是 Jenkinus. 一個可以建置、打包、自動測試和佈署軟體的系統.
|
||||
另外值得一提的事情是版本控制不只僅受益於開發者,團隊中的所有成員和其他工具也都有了能見度,一些專案管理工具可以跟 git 建立鏈結,跟蹤工作的狀況。最知名的例子就是 Jenkinus。 一個可以建置、打包、自動測試和佈署軟體的系統。
|
||||
|
||||
### 什麼是 Git?
|
||||
|
||||
Git 是一個用來追蹤原始碼或任何檔案每次異動的工具, 或者我們可以說 Git 是一個開源的分布式版本控制系統.
|
||||
Git 是一個用來追蹤原始碼或任何檔案每次異動的工具,或者我們可以說 Git 是一個開源的分布式版本控制系統。
|
||||
|
||||
我們的系統有很多種 Git 使用方法, 對我來說最常看到的用法是輸入指令, 但它也有圖形使用者介面, 如微軟開發的 Visual Studio Code 只要透過界面按鈕就可輕鬆管理.
|
||||
我們的系統有很多種 Git 使用方法,對我來說最常看到的用法是輸入指令,但它也有圖形使用者介面,如微軟開發的 Visual Studio Code 只要透過界面按鈕就可輕鬆管理。
|
||||
|
||||
在教學如何安裝 Git 之前, 我們先瀏覽了一下 Git 怎麼使用.
|
||||
在教學如何安裝 Git 之前,我們先瀏覽了一下 Git 怎麼使用。
|
||||
|
||||
我們先用之前建立的資料夾來當範例.
|
||||
我們先用之前建立的資料夾來當範例。
|
||||
|
||||

|
||||
|
||||
首先, 如果想要對資料夾做版本控管, 就要輸入指令`git init`. 現在只要知道這個指令會把目錄建構成儲存庫(repository).
|
||||
首先,如果想要對資料夾做版本控管,就要輸入指令`git init`。現在只要知道這個指令會把目錄建構成儲存庫(repository)。
|
||||
|
||||

|
||||
|
||||
現在我們可以創建一些檔案或資料夾, 也或許你已經有放一些檔案了!? 我們可以輸入指令 `git add .` 將尚未提交的檔案做快照. 圖片中的句點代表的是把所有新增的檔案都添加進去.
|
||||
現在我們可以創建一些檔案或資料夾,也或許你已經有放一些檔案了!? 我們可以輸入指令 `git add .` 將尚未提交的檔案做快照。圖片中的句點代表的是把所有新增的檔案都添加進去。
|
||||
|
||||

|
||||
|
||||
然後我們想要進一步提交檔案, 這個時候就可以輸入 `git commit -m "My First Commit"` . 建議提交時寫一些註解, 這將幫助我們了解發生了什麼事.
|
||||
然後我們想要進一步提交檔案,這個時候就可以輸入 `git commit -m "My First Commit"`。建議提交時寫一些註解,這將幫助我們了解發生了什麼事。
|
||||
|
||||

|
||||

|
||||
|
||||
現在我們可以透過 `git log` 指令, 回顧專案的歷史和註解.
|
||||
現在我們可以透過 `git log` 指令,回顧專案的歷史和註解。
|
||||
|
||||

|
||||
|
||||
我們還能透過 `git status` 指令來檢查倉儲的狀態, 如下圖的前三行, 這表示我們還沒有提交檔案. 如果我們添加一個新檔 samplecode.ps1 , 再次輸入 `git status` 的時候, 會看到我們準備要提交的文件.
|
||||
我們還能透過 `git status` 指令來檢查倉儲的狀態,如下圖的前三行,這表示我們還沒有提交檔案。 如果我們添加一個新檔 samplecode。ps1 ,再次輸入 `git status` 的時候,會看到我們準備要提交的文件。
|
||||
|
||||

|
||||
|
||||
輸入指令 `git add samplecode.ps1` 可以添加新檔案 samplecode.ps1. 然後可以再次輸入 `git status` 確認檔案準備被提交.
|
||||
輸入指令 `git add samplecode。ps1` 可以添加新檔案 samplecode。ps1。然後可以再次輸入 `git status` 確認檔案準備被提交。
|
||||
|
||||

|
||||
|
||||
然後下 `git commit -m "My Second Commit"` 指令.
|
||||
然後下 `git commit -m "My Second Commit"` 指令。
|
||||
|
||||

|
||||
|
||||
再輸入一次 `git status` 可以看見檔案都已提交.
|
||||
再輸入一次 `git status` 可以看見檔案都已提交。
|
||||
|
||||

|
||||
|
||||
我們可以輸入指令 `git log` 顯示最後的異動和第一次提交.
|
||||
我們可以輸入指令 `git log` 顯示最後的異動和第一次提交。
|
||||
|
||||

|
||||
|
||||
如果你想要審查兩個提交的版本之間的差異, 就可以輸入 `git diff b8f87d394 709a8256ab` 來看出有何檔案被新增或修改.
|
||||
如果你想要審查兩個提交的版本之間的差異,就可以輸入 `git diff b8f87d394 709a8256ab` 來看出有何檔案被新增或修改。
|
||||
|
||||

|
||||
|
||||
於是以我們的案例來看, 很清楚的顯示我們添加了一個文件.
|
||||
於是以我們的案例來看,很清楚的顯示我們添加了一個文件。
|
||||
|
||||

|
||||
|
||||
我們還可以透過指令 `git checkout 709a8256ab` 跳回之前提交的版本, 是不是很像時間旅行, 而且不會丟失我們的新檔案. 之後我們將會深入研究這個議題.
|
||||
我們還可以透過指令 `git checkout 709a8256ab` 跳回之前提交的版本,是不是很像時間旅行,而且不會丟失我們的新檔案。 之後我們將會深入研究這個議題。
|
||||
|
||||

|
||||
|
||||
同理的我們可以用相同方法跳回 b8f87d394 版本, 或者你可以看到我用 `git switch -` 取消我的操作.
|
||||
同理的我們可以用相同方法跳回 b8f87d394 版本,或者你可以看到我用 `git switch -` 取消我的操作。
|
||||
|
||||

|
||||
|
||||
@ -124,18 +124,17 @@ Git 是一個用來追蹤原始碼或任何檔案每次異動的工具, 或者
|
||||
- 哦,還有一些做時間旅行!
|
||||
|
||||
|
||||
這個章節的內容似乎跳的有些快, 希望在尚未解說 Git 指令的強大之前, 你能對版本控制的功能有大致上的了解.
|
||||
這個章節的內容似乎跳的有些快,希望在尚未解說 Git 指令的強大之前,你能對版本控制的功能有大致上的了解。
|
||||
|
||||
下一章,我們將會在你的電腦安裝和設置 Git ,並且更深入的解說 Git 的命令和使用案例, 以及 Git 能做到什麼.
|
||||
下一章,我們將會在你的電腦安裝和設置 Git,並且更深入的解說 Git 的命令和使用案例,以及 Git 能做到什麼。
|
||||
|
||||
## Resources
|
||||
## 資源
|
||||
|
||||
- [What is Version Control?](https://www.youtube.com/watch?v=Yc8sCSeMhi4)
|
||||
- [Types of Version Control System](https://www.youtube.com/watch?v=kr62e_n6QuQ)
|
||||
- [Git Tutorial for Beginners](https://www.youtube.com/watch?v=8JJ101D3knE&t=52s)
|
||||
- [Git for Professionals Tutorial](https://www.youtube.com/watch?v=Uszj_k0DGsg)
|
||||
- [Git and GitHub for Beginners - Crash Course](https://www.youtube.com/watch?v=RGOj5yH7evk&t=8s)
|
||||
- [Complete Git and GitHub Tutorial](https://www.youtube.com/watch?v=apGV9Kg7ics)
|
||||
|
||||
See you on [第 36 天](day36.md)
|
||||
- [What is Version Control?](https://www。youtube。com/watch?v=Yc8sCSeMhi4)
|
||||
- [Types of Version Control System](https://www。youtube。com/watch?v=kr62e_n6QuQ)
|
||||
- [Git Tutorial for Beginners](https://www。youtube。com/watch?v=8JJ101D3knE&t=52s)
|
||||
- [Git for Professionals Tutorial](https://www。youtube。com/watch?v=Uszj_k0DGsg)
|
||||
- [Git and GitHub for Beginners - Crash Course](https://www。youtube。com/watch?v=RGOj5yH7evk&t=8s)
|
||||
- [Complete Git and GitHub Tutorial](https://www。youtube。com/watch?v=apGV9Kg7ics)
|
||||
|
||||
See you on [第 36 天](day36.md)
|
Loading…
Reference in New Issue
Block a user