From 8eecf94765942cfc47c3589c45176d41e6ce5237 Mon Sep 17 00:00:00 2001 From: subineru Date: Sat, 7 May 2022 00:48:11 +0800 Subject: [PATCH] day37(zh-tw) in progress --- zh_tw/Days/day37.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/zh_tw/Days/day37.md b/zh_tw/Days/day37.md index 35a3c4b..4913e2e 100644 --- a/zh_tw/Days/day37.md +++ b/zh_tw/Days/day37.md @@ -9,9 +9,9 @@ id: 1048707 --- ## Git 入門 -本篇的作者在這裡很有趣玩諧音梗,把英文的 Getting to know Git 改寫成 Gitting to know Git。 +本篇的作者在這裡玩了個諧音梗,把英文的 Getting to know Git 改寫成 Gitting to know Git。 -在前兩篇文章中我們學習了有關版本控制,[第35天](day35.md)講到了Git做為一個版本控制系統有哪些基本的工作流程。[第36天](day36.md)講到如何安裝、更新和設定,更稍微深入探討主從式和分佈式版本控制系統 Git 之間的理論。 +在前兩篇文章中我們學習了有關版本控制,[第35天](day35.md)講到 Git 做為一個版本控制系統有哪些基本的工作流程。[第36天](day36.md)講到如何安裝、更新和設定,更稍微深入探討主從式和分佈式版本控制系統 Git 之間的理論。 現在,我們將迅速帶過在 Git 常見的指令和使用案例。 @@ -54,11 +54,8 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 幾乎所有的開發工具都支援 Git。 - 開發工具 - 我們曾經提到微軟的 visual studio code 有支援,其他的文字編輯器像是 sublime text 也有提供外掛整合 Git。 - - 團隊工具 - 用來做持續整合/持續佈署的 Jekins, Slack 的訊息框架和專案管理/問題追蹤系統 Jira。 - - 雲端供應商 - 所有的雲端供應商都有支援 Git,Microsoft Azure、Amazon AWS、Google Cloud Platform。 - - 基於Git的服務 - GitHub、GitLab 和 BitBucket 之後會有更詳盡的探討。我聽過這些服務是程式碼的社交網路! ### Git Cheatsheet @@ -69,6 +66,7 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 ### Git 基本操作 + | 指令 | 範例 | 描述 | | --------------- | ----------------------------- | ----------------------------------------------------------------------------------- | | git init | `git init ` | 在指定的資料夾上建立一個空的 Git 儲存庫。 | @@ -82,6 +80,7 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 ### Git Undoing Changes + | 指令 | 範例 | 描述 | | ------------ | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | git revert | `git revert ` | 做反向處理,回復這次提交的異動,並建立新的提供。 | @@ -90,6 +89,7 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 ### Git Rewriting History + | 指令 | 範例 | 描述 | | ------------ | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | git commit | `git commit --amend` | Replace the last commit with the staged changes and last commit combined. Use with nothing staged to edit the last commit’s message. | @@ -98,6 +98,7 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 ### Git Branches + | 指令 | 範例 | 描述 | | -------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------- | | git branch | `git branch` | List all of the branches in your repo. Add a argument to create a new branch with the name . | @@ -106,6 +107,7 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 ### Git Remote Repositories + | 指令 | 範例 | 描述 | | ---------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | git remote add | `git remote add ` | Create a new connection to a remote repo. After adding a remote, you can use as a shortcut for in other commands. | @@ -115,6 +117,7 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 ### Git Diff + | 指令 | 範例 | 描述 | | ------------------- | --------------------- | ------------------------------------------------------------ | | git diff HEAD | `git diff HEAD` | Show difference between working directory and last commit. | @@ -122,6 +125,7 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 ### Git Config + | 指令 | 範例 | 描述 | | ----------------------------------------------------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | git config --global user.name | `git config --global user.name ` | Define the author name to be used for all commits by the current user. | @@ -132,18 +136,21 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 ### Git Rebase + | 指令 | 範例 | 描述 | | --------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | | git rebase -i | `git rebase -i ` | Interactively rebase current branch onto. Launches editor to enter commands for how each commit will be transferred to the new base. | ### Git Pull + | 指令 | 範例 | 描述 | | --------------------------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | | git pull --rebase | `git pull --rebase ` | Fetch the remote’s copy of current branch and rebases it into the local copy. Uses git rebase instead of merge to integrate the branches. | ### Git Reset + | 指令 | 範例 | 描述 | | -------------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | git reset | `git reset ` | Reset staging area to match most recent commit, but leave the working directory unchanged. | @@ -153,6 +160,7 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 ### Git Push + | 指令 | 範例 | Description | | -------------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------------- | | git push --force | `git push --force` | 強迫推送即使會發生 non-fast-forward。不要用 --force 選項,除非你很清楚自己在做什麼。 | @@ -169,5 +177,4 @@ Git 對使用的人並不友善,事實上我們必須花費時間討論命令 - [Complete Git and GitHub Tutorial](https://www.youtube.com/watch?v=apGV9Kg7ics) - [Git cheatsheet](https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet) - -See you on [第 38 天](day38.md) \ No newline at end of file +See you on [第 38 天](day38.md)