Skip to content

Commit

Permalink
doc: Update git_tutorial to show how to create project
Browse files Browse the repository at this point in the history
Update git_tutorial to show how to create project for Git.
  • Loading branch information
burstknight committed Feb 11, 2022
1 parent 05b9a83 commit 4e7cdd4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ This document is to log all changes for this project.
- Add motivation into readme.
- Add the direcotry `git_tutorial` to store tutorial document.
- Update readme to link git tutorial document.
- Update `git_tutorial/Readme` to show how to change configuration for a project.
- Update `git_tutorial/README.md` to show how to change configuration for a project.
- Update `git_tutorial/README.md` to show how to create a project for Git.

### Changed

Expand Down
16 changes: 16 additions & 0 deletions git_tutorial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,19 @@ Git預設使用的編輯器是Vim,如果有需要也可使用GUI的編輯器
```bash
git config --list
```

## 建立專案給Git管理
接下來我們來建立一個專案,並且使用Git來管理這個專案。我們先建立一個專案,第一步先建一個資料夾,用專案的名稱來為這個資料夾命名。我們以`testGit`來當作專案名稱,在終端機中可以輸入下面的指令來建立專案資料夾:
```bash
mkdir testGit
```
建立好之後就切換進`testGit`中,我們也可以在終端機中輸入指令來切換當前的目錄:
```bash
cd testGit
```

建立好專案並且進到專案資料夾後,我們需要使用下面的指令來初始化專案:
```bash
git init
```
使用上面的指令後,應該會發現專案的資料夾中會出現`.git`的目錄,這個目錄就是Git能對專案進行版本管控的關鍵。我們使用Git對專案版本管控時,就是把專案中每次改動都記錄到`.git`中。也就是說,**只要把`.git`目錄刪掉,Git就沒辦法再對該專案進行版本管控。**

0 comments on commit 4e7cdd4

Please sign in to comment.