介紹gitea 和 Sourcetree
最近版控工具安裝需求,網路上有查詢較熱門的GIT工具
1.Gitea
2.Gogs
3.GitHub EE
4.GitLab CE
5.GitLab EE
6.BitBucket
7.RhodeCode CE
Gitea網站上有做各工具的比較表
https://docs.gitea.io/zh-cn/comparison/
下面為安裝Gitea 和 Sourcetree的安裝步驟
前置作業
sudo yum install git
sudo mkdir -p /opt/giteasrv && cd /opt/giteasrv
下載gitea linux程式
https://dl.gitea.io/gitea
最新版本gitea-1.12.0-linux-amd64
sudo wget -O gitea https://dl.gitea.io/gitea/1.12.0/gitea-1.12.0-linux-amd64

執行gitea
修改檔案權限
sudo chmod +x gitea
sudo ./gitea web
註:Ctrl + C 關閉程式
gitea加入service
sudo vi /etc/systemd/system/gitea.service
[Unit]
Description=gitea
[Service]
User=root
ExecStart=/opt/giteasrv/gitea
Restart=on-abort
sudo systemctl daemon-reload
sudo systemctl start gitea
sudo systemctl enable gitea
註冊並登入gitea web
WEB 預設port為 3000
用瀏覽器登入http://127.0.0.1:3000, 按註冊, 會進行第一次的設定
資料庫可以選取[SQLite3]
gitea設定檔
sudo vi /opt/giteasrv/custom/conf/app.ini
即可以看到剛在瀏覽器設定的內容
可關閉密碼複雜度
[security]
PASSWORD_COMPLEXITY = off
也可以調整相關連線port設定
sudo vi /opt/giteasrv/custom/conf/app.ini
WEB 預設port為 3000
Git GUI Client 安裝
許多支援Git 的Client軟體
https://git-scm.com/download/gui/windows
下載Sourcetree後並安裝

gitea 建立新的Repository
使用瀏覽器登入gitea service

Sourcetree取gitea repository

Sourcetree Commit & Push
資料夾[test]檔案有異動,在自動顯示在[Unstaged files]
[Commit]會出現1個動作尚未執行
先按[Stage All],將檔案移至[Staged files]

輸入異動說明後,執行[Commit],再執行[Push]
或是直接勾選[Push changes immediately to origin/master],執行[Commit]後自動再執行[Push]
