Initial commit

This commit is contained in:
davemark_su 2023-10-24 15:51:47 +08:00 committed by SRC0730
commit a783cff8fa
34 changed files with 589 additions and 0 deletions

405
.gitignore vendored Normal file
View File

@ -0,0 +1,405 @@
# Created by https://www.toptal.com/developers/gitignore/api/visualstudio
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio
### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
### VisualStudio Patch ###
# Additional files built by Visual Studio
# End of https://www.toptal.com/developers/gitignore/api/visualstudio

184
README.md Normal file
View File

@ -0,0 +1,184 @@
# Old Project
此專案示範如何將手邊上傳至 Gitea
## 環境準備
### Git
如 SVN為操作指令必要安裝至[Git 官網](https://git-scm.com/)下載安裝即可。
![Git](doc_image/2023-10-20-16-28-09.png)
### SourceTree
如 TortioseSVN為 Git 操作 IDE 版本控管 Tools至[SourceTree 官網](https://www.sourcetreeapp.com/)下載安裝即可。
![SourceTree](doc_image/2023-10-20-14-11-15.png)
## Gitea 新增 Repository(儲存庫)
主機位置:[http://twvoadtpw100004/](http://twvoadtpw100004/)
1. 首頁進入組織
於 Gitea 登入後首頁儀表板點選`組織`頁籤,點選 `OAD-WebTeam` 進入組織頁面。
![首頁儀錶板](doc_image/2023-10-20-10-23-38.png)
2. 新增儲存庫
進入組織頁面後,點擊`新增儲存庫`按鈕新增 git 專案。
![組織頁面](doc_image/2023-10-20-10-28-19.png)
3. 登打儲存庫資料
填寫儲存庫名稱(專案名稱),擁有者須為 `OAD-WebTeam` ,瀏覽權限設定為 `Private 私有`,相關資料填妥後建立儲存庫。
![新增儲存庫](doc_image/2023-10-20-10-31-38.png)
4. 完成建立儲存庫
![儲存庫](doc_image/2023-10-20-13-57-46.png)
## 專案 git 初始化
### 建置 .gitignore 範本
為避免 git 同步時,上傳不必要檔案(ex. packages、node_modules),故會於該檔案設定忽略同步目錄。
1. 至[gitignore](https://www.toptal.com/developers/gitignore)找到對應開發 IDE/技術範本文件
![gitignore](doc_image/2023-10-20-16-22-39.png)
2. 下載儲存至專案根目錄 `.gitignore` (內容以 Visual Studio 為例)
![content](doc_image/2023-10-20-16-23-21.png)
### 上傳 Source Code
專案將依照 [GitFlow](https://gitbook.tw/chapters/gitflow/why-need-git-flow) 原則進行版控,操作方式以 [使用 command line git 指令操作](#使用-command-line-git-指令操作) 或 [使用 SourceTree 介面操作](#使用-sourcetree-介面操作) 兩種方式擇一即可。
#### 使用 command line git 指令操作
1. 打開 cmd 視窗並移動至專案目錄
```cmd
cd /d D:\_SRC\_Coder\Git\OldProject\
```
2. git 初始化
```cmd
git init
```
![git init](doc_image/2023-10-24-14-21-34.png)
執行完成後會產生 `.git` folder
![.git folder](doc_image/2023-10-24-14-08-33.png)
3. 設定 Remote
設定遠端 Git 主機位置
```cmd
git remote add origin http://twvoadtpw100004/OAD-WebTeam/OldProject.git
```
4. Commit & Push
本階段我們將第一次同步並推送至主機
- git add增加異動清單(暫存)
```cmd
git add -A
```
![git add](doc_image/2023-10-20-16-45-46.png)
- git commit登打異動資訊
```cmd
git commit -m "Initial commit"
```
![git commit](doc_image/2023-10-24-15-40-27.png)
- `git flow` 機制建立
```cmd
git flow init -d
```
![git flow init](doc_image/2023-10-24-14-25-58.png)
- 上傳至遠端主機
```cmd
git push -u origin master
git push -u origin develop
```
![git push master](doc_image/2023-10-24-15-46-56.png)
![git push develop](doc_image/2023-10-24-15-47-33.png)
#### 使用 SourceTree 介面操作
1. 開啟 `SourceTree` ,至 `Create` 頁籤,填入程式相關路徑及專案名稱後,新增即可。
![Create](doc_image/2023-10-20-11-30-23.png)
若有跳出提示表示資料夾已存在,點擊 Yes 繼續即可。
![CreateAlert](doc_image/2023-10-24-14-33-01.png)
執行完成後會產生 `.git` folder
![.git folder](doc_image/2023-10-24-14-08-33.png)
2. 新增 Remote
![Remote](doc_image/2023-10-20-11-35-47.png)
![configuration](doc_image/2023-10-20-11-36-40.png)
3. 設定 Remote 資訊Remote name 勾選 `Default remote` ,登打 Gitea Repository 路徑及登入帳號。
![Remote](doc_image/2023-10-24-14-38-12.png)
![Remote info](doc_image/2023-10-24-14-37-17.png)
4. 設定 statged files
![add](doc_image/2023-10-24-14-58-05.png)
![add done](doc_image/2023-10-24-14-59-21.png)
5. 登打 commit message
在文字框內登打 `Initial commit` 後,點擊 `commit` 按鈕。
![Initial commit](doc_image/2023-10-24-15-14-33.png)
6. 切換至左方 `BRANCHS` 底下 `master` 分支,我們會看到剛剛增加的 commit並點擊該項目可於下方查看異動項目清單。這時我們點擊右上角 `Git-flow` 按鈕設定未來上版規則。
![Setting Git-flow](doc_image/2023-10-24-15-27-43.png)
7. 使用預設即可,按 OK。
![OK](doc_image/2023-10-24-15-21-37.png)
8. 完成建立 Git-flow 規則
![Git-flow](doc_image/2023-10-24-15-30-33.png)
### 注意事項
- 如果執行 `git push` 有跳出輸入帳號密碼資訊,輸入 Gitea 帳密即可。
![輸入帳密](doc_image/2023-10-20-16-40-29.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB